Skip to content

Commit

Permalink
vt320: Fix broken home / end keys
Browse files Browse the repository at this point in the history
According to vt320 terminfo (as well as screen and xterm, which
connectbot uses to identify itself by default)
khome=\E[1~ and kend=\E[4~

The vt320.java however used \E[H for khome and \E[F for kend.
But \E[H is used as a sequence to "move cursor to home", and not
as a key escape code and \E[F isn't mapped at all.

The FunctionKeyShift[15] = Find and FunctionKeyShift[16] = Select
which were mapped to \E[1~ and \E[4~ have been removed from vt320.java.
They have never been used anyways.

for more info see
man terminfo(5)
infocmp xterm
infocmp screen
infocmp vt320
  • Loading branch information
m0vie authored and ddrown committed Jan 16, 2013
1 parent 45b52e2 commit 53dbe73
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/de/mud/terminal/vt320.java
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ public vt320(int width, int height) {
Remove[0] = Remove[1] = Remove[2] = Remove[3] = "\u001b[3~";
PrevScn[0] = PrevScn[1] = PrevScn[2] = PrevScn[3] = "\u001b[5~";
NextScn[0] = NextScn[1] = NextScn[2] = NextScn[3] = "\u001b[6~";
KeyHome[0] = KeyHome[1] = KeyHome[2] = KeyHome[3] = "\u001b[H";
KeyEnd[0] = KeyEnd[1] = KeyEnd[2] = KeyEnd[3] = "\u001b[F";
KeyHome[0] = KeyHome[1] = KeyHome[2] = KeyHome[3] = "\u001b[1~";
KeyEnd[0] = KeyEnd[1] = KeyEnd[2] = KeyEnd[3] = "\u001b[4~";
Escape[0] = Escape[1] = Escape[2] = Escape[3] = "\u001b";
if (vms) {
BackSpace[1] = "" + (char) 10; // VMS shift deletes word back
Expand All @@ -240,8 +240,6 @@ public vt320(int width, int height) {
}

/* some more VT100 keys */
Find = "\u001b[1~";
Select = "\u001b[4~";
Help = "\u001b[28~";
Do = "\u001b[29~";

Expand Down Expand Up @@ -278,8 +276,6 @@ public vt320(int width, int height) {
FunctionKeyAlt[i] = "";
FunctionKeyCtrl[i] = "";
}
FunctionKeyShift[15] = Find;
FunctionKeyShift[16] = Select;


TabKey[0] = "\u0009";
Expand Down

0 comments on commit 53dbe73

Please sign in to comment.