* Changed generated key sequences to be more ANSI/xterm.
* Set TERM to "xterm".
* Removed unnecessary {Begin,End}ViewTransaction() in TermView::Draw().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26022 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -496,7 +496,7 @@ Shell::_Spawn(int row, int col, const char *encoding, int argc, const char **arg
|
|||||||
/*
|
/*
|
||||||
* setenv TERM and TTY.
|
* setenv TERM and TTY.
|
||||||
*/
|
*/
|
||||||
setenv("TERM", "beterm", true);
|
setenv("TERM", "xterm", true);
|
||||||
setenv("TTY", ttyName, true);
|
setenv("TTY", ttyName, true);
|
||||||
setenv("TTYPE", encoding, true);
|
setenv("TTYPE", encoding, true);
|
||||||
setenv("SHELL", argv[0], true);
|
setenv("SHELL", argv[0], true);
|
||||||
|
|||||||
@@ -1019,8 +1019,6 @@ TermView::Draw(BRect updateRect)
|
|||||||
//debug_printf("TermView::Draw(): (%ld, %ld) - (%ld, %ld), top: %f, fontHeight: %d, scrollOffset: %f\n",
|
//debug_printf("TermView::Draw(): (%ld, %ld) - (%ld, %ld), top: %f, fontHeight: %d, scrollOffset: %f\n",
|
||||||
//x1, y1, x2, y2, updateRect.top, fFontHeight, fScrollOffset);
|
//x1, y1, x2, y2, updateRect.top, fFontHeight, fScrollOffset);
|
||||||
|
|
||||||
Window()->BeginViewTransaction();
|
|
||||||
|
|
||||||
for (int32 j = y1; j <= y2; j++) {
|
for (int32 j = y1; j <= y2; j++) {
|
||||||
int32 k = x1;
|
int32 k = x1;
|
||||||
char buf[fTermColumns * 4 + 1];
|
char buf[fTermColumns * 4 + 1];
|
||||||
@@ -1062,8 +1060,6 @@ TermView::Draw(BRect updateRect)
|
|||||||
|
|
||||||
if (fCursor >= TermPos(x1, y1) && fCursor <= TermPos(x2, y2))
|
if (fCursor >= TermPos(x1, y1) && fCursor <= TermPos(x2, y2))
|
||||||
_DrawCursor();
|
_DrawCursor();
|
||||||
|
|
||||||
Window()->EndViewTransaction();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1163,6 +1159,14 @@ TermView::KeyDown(const char *bytes, int32 numBytes)
|
|||||||
toWrite = "\r";
|
toWrite = "\r";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case B_DELETE:
|
||||||
|
toWrite = DELETE_KEY_CODE;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case B_BACKSPACE:
|
||||||
|
toWrite = BACKSPACE_KEY_CODE;
|
||||||
|
break;
|
||||||
|
|
||||||
case B_LEFT_ARROW:
|
case B_LEFT_ARROW:
|
||||||
if (rawChar == B_LEFT_ARROW) {
|
if (rawChar == B_LEFT_ARROW) {
|
||||||
if (mod & B_SHIFT_KEY) {
|
if (mod & B_SHIFT_KEY) {
|
||||||
@@ -1251,7 +1255,6 @@ TermView::KeyDown(const char *bytes, int32 numBytes)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case B_FUNCTION_KEY:
|
case B_FUNCTION_KEY:
|
||||||
// TODO: Why not just fShell->Write(key) ?
|
|
||||||
for (int32 i = 0; i < 12; i++) {
|
for (int32 i = 0; i < 12; i++) {
|
||||||
if (key == function_keycode_table[i]) {
|
if (key == function_keycode_table[i]) {
|
||||||
fShell->Write(function_key_char_table[i], 5);
|
fShell->Write(function_key_char_table[i], 5);
|
||||||
|
|||||||
@@ -48,10 +48,10 @@ F12_KEY,
|
|||||||
|
|
||||||
char *function_key_char_table [] =
|
char *function_key_char_table [] =
|
||||||
{
|
{
|
||||||
"\033[11~",
|
"\033OP",
|
||||||
"\033[12~",
|
"\033OQ",
|
||||||
"\033[13~",
|
"\033OR",
|
||||||
"\033[14~",
|
"\033OS",
|
||||||
"\033[15~",
|
"\033[15~",
|
||||||
"\033[16~",
|
"\033[16~",
|
||||||
"\033[17~",
|
"\033[17~",
|
||||||
|
|||||||
@@ -64,22 +64,22 @@
|
|||||||
#define PAGE_DOWN_KEY 0x36
|
#define PAGE_DOWN_KEY 0x36
|
||||||
|
|
||||||
|
|
||||||
|
#define LEFT_ARROW_KEY_CODE "\033OD"
|
||||||
#define LEFT_ARROW_KEY_CODE "\033[D"
|
#define RIGHT_ARROW_KEY_CODE "\033OC"
|
||||||
#define RIGHT_ARROW_KEY_CODE "\033[C"
|
#define UP_ARROW_KEY_CODE "\033OA"
|
||||||
#define UP_ARROW_KEY_CODE "\033[A"
|
#define DOWN_ARROW_KEY_CODE "\033OB"
|
||||||
#define DOWN_ARROW_KEY_CODE "\033[B"
|
|
||||||
|
|
||||||
#define CTRL_LEFT_ARROW_KEY_CODE "\033[5D"
|
#define CTRL_LEFT_ARROW_KEY_CODE "\033[5D"
|
||||||
#define CTRL_RIGHT_ARROW_KEY_CODE "\033[5C"
|
#define CTRL_RIGHT_ARROW_KEY_CODE "\033[5C"
|
||||||
#define CTRL_UP_ARROW_KEY_CODE "\033[5A"
|
#define CTRL_UP_ARROW_KEY_CODE "\033[5A"
|
||||||
#define CTRL_DOWN_ARROW_KEY_CODE "\033[5B"
|
#define CTRL_DOWN_ARROW_KEY_CODE "\033[5B"
|
||||||
|
|
||||||
//#define HOME_KEY_CODE "\033[@"
|
#define DELETE_KEY_CODE "\033[3~"
|
||||||
#define HOME_KEY_CODE "\033[1~"
|
#define BACKSPACE_KEY_CODE "\177"
|
||||||
|
|
||||||
|
#define HOME_KEY_CODE "\033OH"
|
||||||
#define INSERT_KEY_CODE "\033[2~"
|
#define INSERT_KEY_CODE "\033[2~"
|
||||||
//#define END_KEY_CODE "\033[["
|
#define END_KEY_CODE "\033OF"
|
||||||
#define END_KEY_CODE "\033[4~"
|
|
||||||
#define PAGE_UP_KEY_CODE "\033[5~"
|
#define PAGE_UP_KEY_CODE "\033[5~"
|
||||||
#define PAGE_DOWN_KEY_CODE "\033[6~"
|
#define PAGE_DOWN_KEY_CODE "\033[6~"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user