* 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:
parent
d6b036858b
commit
a71fd7987b
@ -496,7 +496,7 @@ Shell::_Spawn(int row, int col, const char *encoding, int argc, const char **arg
|
||||
/*
|
||||
* setenv TERM and TTY.
|
||||
*/
|
||||
setenv("TERM", "beterm", true);
|
||||
setenv("TERM", "xterm", true);
|
||||
setenv("TTY", ttyName, true);
|
||||
setenv("TTYPE", encoding, 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",
|
||||
//x1, y1, x2, y2, updateRect.top, fFontHeight, fScrollOffset);
|
||||
|
||||
Window()->BeginViewTransaction();
|
||||
|
||||
for (int32 j = y1; j <= y2; j++) {
|
||||
int32 k = x1;
|
||||
char buf[fTermColumns * 4 + 1];
|
||||
@ -1062,8 +1060,6 @@ TermView::Draw(BRect updateRect)
|
||||
|
||||
if (fCursor >= TermPos(x1, y1) && fCursor <= TermPos(x2, y2))
|
||||
_DrawCursor();
|
||||
|
||||
Window()->EndViewTransaction();
|
||||
}
|
||||
|
||||
|
||||
@ -1162,7 +1158,15 @@ TermView::KeyDown(const char *bytes, int32 numBytes)
|
||||
if (rawChar == B_RETURN)
|
||||
toWrite = "\r";
|
||||
break;
|
||||
|
||||
|
||||
case B_DELETE:
|
||||
toWrite = DELETE_KEY_CODE;
|
||||
break;
|
||||
|
||||
case B_BACKSPACE:
|
||||
toWrite = BACKSPACE_KEY_CODE;
|
||||
break;
|
||||
|
||||
case B_LEFT_ARROW:
|
||||
if (rawChar == B_LEFT_ARROW) {
|
||||
if (mod & B_SHIFT_KEY) {
|
||||
@ -1251,7 +1255,6 @@ TermView::KeyDown(const char *bytes, int32 numBytes)
|
||||
break;
|
||||
|
||||
case B_FUNCTION_KEY:
|
||||
// TODO: Why not just fShell->Write(key) ?
|
||||
for (int32 i = 0; i < 12; i++) {
|
||||
if (key == function_keycode_table[i]) {
|
||||
fShell->Write(function_key_char_table[i], 5);
|
||||
|
@ -48,10 +48,10 @@ F12_KEY,
|
||||
|
||||
char *function_key_char_table [] =
|
||||
{
|
||||
"\033[11~",
|
||||
"\033[12~",
|
||||
"\033[13~",
|
||||
"\033[14~",
|
||||
"\033OP",
|
||||
"\033OQ",
|
||||
"\033OR",
|
||||
"\033OS",
|
||||
"\033[15~",
|
||||
"\033[16~",
|
||||
"\033[17~",
|
||||
|
@ -64,22 +64,22 @@
|
||||
#define PAGE_DOWN_KEY 0x36
|
||||
|
||||
|
||||
|
||||
#define LEFT_ARROW_KEY_CODE "\033[D"
|
||||
#define RIGHT_ARROW_KEY_CODE "\033[C"
|
||||
#define UP_ARROW_KEY_CODE "\033[A"
|
||||
#define DOWN_ARROW_KEY_CODE "\033[B"
|
||||
#define LEFT_ARROW_KEY_CODE "\033OD"
|
||||
#define RIGHT_ARROW_KEY_CODE "\033OC"
|
||||
#define UP_ARROW_KEY_CODE "\033OA"
|
||||
#define DOWN_ARROW_KEY_CODE "\033OB"
|
||||
|
||||
#define CTRL_LEFT_ARROW_KEY_CODE "\033[5D"
|
||||
#define CTRL_RIGHT_ARROW_KEY_CODE "\033[5C"
|
||||
#define CTRL_UP_ARROW_KEY_CODE "\033[5A"
|
||||
#define CTRL_DOWN_ARROW_KEY_CODE "\033[5B"
|
||||
|
||||
//#define HOME_KEY_CODE "\033[@"
|
||||
#define HOME_KEY_CODE "\033[1~"
|
||||
#define DELETE_KEY_CODE "\033[3~"
|
||||
#define BACKSPACE_KEY_CODE "\177"
|
||||
|
||||
#define HOME_KEY_CODE "\033OH"
|
||||
#define INSERT_KEY_CODE "\033[2~"
|
||||
//#define END_KEY_CODE "\033[["
|
||||
#define END_KEY_CODE "\033[4~"
|
||||
#define END_KEY_CODE "\033OF"
|
||||
#define PAGE_UP_KEY_CODE "\033[5~"
|
||||
#define PAGE_DOWN_KEY_CODE "\033[6~"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user