Hi,
My environment is ksh88 (ugh!) under HP-UX, with Putty as my
connection client.
I'm trying to remap my arrow, home, and end keys to the emacs editing
mode key sequences.
I've got the arrow keys working thanks to Google:
# vt100 normal (non-application) cursor keys
# alias -x __A=$(print '\020') # Set the up arrow to Ctrl-P (previous
command)
# alias -x __B=$(print '\016') # Set the down arrow to Ctrl-N (next
command)
# alias -x __C=$(print '\006') # Set the right arrow to Ctrl-F (move
forward)
# alias -x __D=$(print '\002') # Set the left arrow to Ctrl-B (move
backwards)
# Home and End for typical vt100 emulations
# (this doesn't work, I can't find the key codes for Home and End. Oh
well...)
# alias -x __F=$(print '\001') # Set the home key to Ctrl-A (start of
command)
# alias -x __K=$(print '\005') # Set the end key to Ctrl-E (end of
command)
alias __A=$(print '\0020') # ^P = up = previous command
alias __B=$(print '\0016') # ^N = down = next command
alias __C=$(print '\0006') # ^F = right = forward a character
alias __D=$(print '\0002') # ^B = left = back a character
alias __H=$(print '\0001') # ^A = home = beginning of line
alias __W=$(print '\0005') # ^E = end = end of line
The Putty help page says:
4.4.2 Changing the action of the Home and End keys
The Unix terminal emulator rxvt disagrees with the rest of the world
about what character sequences should be sent to the server by the
Home and End keys.
xterm, and other terminals, send ESC [1~ for the Home key, and ESC [4~
for the End key. rxvt sends ESC [H for the Home key and ESC [Ow for
the End key.
If you find an application on which the Home and End keys aren't
working, you could try switching this option to see if it helps.
If my Putty setting is set to xterm, neither Home nor End work - both
just cause the bell sound (from the ESC [1 and ESC [4 sequence???) and
display ~ in the terminal.
If my Putty setting is set to rxvt, Home works - the alias defined
above causes the the cursor to move to the beginning of the line. But
End causes the bell sound, and displays w in the terminal.
The arrow keys work in both settings.
Questions:
1) How can I get the End key to move to the end of line? IOW, I need
to alias the key sequence (either ESC [4~ or ESC [0w) to Cntl-E.
2) Where can I find documentation for the syntax in the aliases found
via Google? IOW I'd like more details on the "__A", "__B", etc. and
the $(print '\0020'), etc. syntax in the above aliases. If it's in
the man pages I can't find it. A good web page documenting this would
be fantastic.
Thanks for the help,
Scott
|
|
0
|
|
|
|
Reply
|
sas_l_739 (82)
|
3/10/2010 7:42:21 PM |
|
Surely this is documented somewhere???
On Mar 11, 6:42=A0am, Scott Bass <sas_l_...@yahoo.com.au> wrote:
> Hi,
>
> My environment is ksh88 (ugh!) under HP-UX, with Putty as my
> connection client.
>
> I'm trying to remap my arrow, home, and end keys to the emacs editing
> mode key sequences.
>
> I've got the arrow keys working thanks to Google:
>
> # vt100 normal (non-application) cursor keys
> # alias -x __A=3D$(print '\020') =A0# Set the up arrow to Ctrl-P (previou=
s
> command)
> # alias -x __B=3D$(print '\016') =A0# Set the down arrow to Ctrl-N (next
> command)
> # alias -x __C=3D$(print '\006') =A0# Set the right arrow to Ctrl-F (move
> forward)
> # alias -x __D=3D$(print '\002') =A0# Set the left arrow to Ctrl-B (move
> backwards)
>
> # Home and End for typical vt100 emulations
> # (this doesn't work, I can't find the key codes for Home and End. =A0Oh
> well...)
> # alias -x __F=3D$(print '\001') =A0# Set the home key to Ctrl-A (start o=
f
> command)
> # alias -x __K=3D$(print '\005') =A0# Set the end key to Ctrl-E (end of
> command)
>
> alias __A=3D$(print '\0020') =A0 =A0# ^P =3D up =A0 =A0=3D previous comma=
nd
> alias __B=3D$(print '\0016') =A0 =A0# ^N =3D down =A0=3D next command
> alias __C=3D$(print '\0006') =A0 =A0# ^F =3D right =3D forward a characte=
r
> alias __D=3D$(print '\0002') =A0 =A0# ^B =3D left =A0=3D back a character
> alias __H=3D$(print '\0001') =A0 =A0# ^A =3D home =A0=3D beginning of lin=
e
> alias __W=3D$(print '\0005') =A0 =A0# ^E =3D end =A0 =3D end of line
>
> The Putty help page says:
>
> 4.4.2 Changing the action of the Home and End keys
> The Unix terminal emulator rxvt disagrees with the rest of the world
> about what character sequences should be sent to the server by the
> Home and End keys.
>
> xterm, and other terminals, send ESC [1~ for the Home key, and ESC [4~
> for the End key. rxvt sends ESC [H for the Home key and ESC [Ow for
> the End key.
>
> If you find an application on which the Home and End keys aren't
> working, you could try switching this option to see if it helps.
>
> If my Putty setting is set to xterm, neither Home nor End work - both
> just cause the bell sound (from the ESC [1 and ESC [4 sequence???) and
> display ~ in the terminal.
>
> If my Putty setting is set to rxvt, Home works - the alias defined
> above causes the the cursor to move to the beginning of the line. =A0But
> End causes the bell sound, and displays w in the terminal.
>
> The arrow keys work in both settings.
>
> Questions:
>
> 1) =A0How can I get the End key to move to the end of line? =A0IOW, I nee=
d
> to alias the key sequence (either ESC [4~ or ESC [0w) to Cntl-E.
>
> 2) =A0Where can I find documentation for the syntax in the aliases found
> via Google? =A0IOW I'd like more details on the "__A", "__B", etc. and
> the $(print '\0020'), etc. syntax in the above aliases. =A0If it's in
> the man pages I can't find it. =A0A good web page documenting this would
> be fantastic.
>
> Thanks for the help,
> Scott
|
|
0
|
|
|
|
Reply
|
Scott
|
3/15/2010 9:18:58 PM
|
|
Surely this is documented somewhere???
On Mar 11, 6:42=A0am, Scott Bass <sas_l_...@yahoo.com.au> wrote:
> Hi,
>
> My environment is ksh88 (ugh!) under HP-UX, with Putty as my
> connection client.
>
> I'm trying to remap my arrow, home, and end keys to the emacs editing
> mode key sequences.
>
> I've got the arrow keys working thanks to Google:
>
> # vt100 normal (non-application) cursor keys
> # alias -x __A=3D$(print '\020') =A0# Set the up arrow to Ctrl-P (previou=
s
> command)
> # alias -x __B=3D$(print '\016') =A0# Set the down arrow to Ctrl-N (next
> command)
> # alias -x __C=3D$(print '\006') =A0# Set the right arrow to Ctrl-F (move
> forward)
> # alias -x __D=3D$(print '\002') =A0# Set the left arrow to Ctrl-B (move
> backwards)
>
> # Home and End for typical vt100 emulations
> # (this doesn't work, I can't find the key codes for Home and End. =A0Oh
> well...)
> # alias -x __F=3D$(print '\001') =A0# Set the home key to Ctrl-A (start o=
f
> command)
> # alias -x __K=3D$(print '\005') =A0# Set the end key to Ctrl-E (end of
> command)
>
> alias __A=3D$(print '\0020') =A0 =A0# ^P =3D up =A0 =A0=3D previous comma=
nd
> alias __B=3D$(print '\0016') =A0 =A0# ^N =3D down =A0=3D next command
> alias __C=3D$(print '\0006') =A0 =A0# ^F =3D right =3D forward a characte=
r
> alias __D=3D$(print '\0002') =A0 =A0# ^B =3D left =A0=3D back a character
> alias __H=3D$(print '\0001') =A0 =A0# ^A =3D home =A0=3D beginning of lin=
e
> alias __W=3D$(print '\0005') =A0 =A0# ^E =3D end =A0 =3D end of line
>
> The Putty help page says:
>
> 4.4.2 Changing the action of the Home and End keys
> The Unix terminal emulator rxvt disagrees with the rest of the world
> about what character sequences should be sent to the server by the
> Home and End keys.
>
> xterm, and other terminals, send ESC [1~ for the Home key, and ESC [4~
> for the End key. rxvt sends ESC [H for the Home key and ESC [Ow for
> the End key.
>
> If you find an application on which the Home and End keys aren't
> working, you could try switching this option to see if it helps.
>
> If my Putty setting is set to xterm, neither Home nor End work - both
> just cause the bell sound (from the ESC [1 and ESC [4 sequence???) and
> display ~ in the terminal.
>
> If my Putty setting is set to rxvt, Home works - the alias defined
> above causes the the cursor to move to the beginning of the line. =A0But
> End causes the bell sound, and displays w in the terminal.
>
> The arrow keys work in both settings.
>
> Questions:
>
> 1) =A0How can I get the End key to move to the end of line? =A0IOW, I nee=
d
> to alias the key sequence (either ESC [4~ or ESC [0w) to Cntl-E.
>
> 2) =A0Where can I find documentation for the syntax in the aliases found
> via Google? =A0IOW I'd like more details on the "__A", "__B", etc. and
> the $(print '\0020'), etc. syntax in the above aliases. =A0If it's in
> the man pages I can't find it. =A0A good web page documenting this would
> be fantastic.
>
> Thanks for the help,
> Scott
|
|
0
|
|
|
|
Reply
|
Scott
|
3/15/2010 9:19:28 PM
|
|
On 10 mar, 20:42, Scott Bass <sas_l_...@yahoo.com.au> wrote:
> Hi,
>
> My environment is ksh88 (ugh!) under HP-UX, with Putty as my
> connection client.
>
> I'm trying to remap my arrow, home, and end keys to the emacs editing
> mode key sequences.
>
> I've got the arrow keys working thanks to Google:
>
> # vt100 normal (non-application) cursor keys
> # alias -x __A=3D$(print '\020') =A0# Set the up arrow to Ctrl-P (previou=
s
> command)
> # alias -x __B=3D$(print '\016') =A0# Set the down arrow to Ctrl-N (next
> command)
> # alias -x __C=3D$(print '\006') =A0# Set the right arrow to Ctrl-F (move
> forward)
> # alias -x __D=3D$(print '\002') =A0# Set the left arrow to Ctrl-B (move
> backwards)
>
> # Home and End for typical vt100 emulations
> # (this doesn't work, I can't find the key codes for Home and End. =A0Oh
> well...)
> # alias -x __F=3D$(print '\001') =A0# Set the home key to Ctrl-A (start o=
f
> command)
> # alias -x __K=3D$(print '\005') =A0# Set the end key to Ctrl-E (end of
> command)
>
> alias __A=3D$(print '\0020') =A0 =A0# ^P =3D up =A0 =A0=3D previous comma=
nd
> alias __B=3D$(print '\0016') =A0 =A0# ^N =3D down =A0=3D next command
> alias __C=3D$(print '\0006') =A0 =A0# ^F =3D right =3D forward a characte=
r
> alias __D=3D$(print '\0002') =A0 =A0# ^B =3D left =A0=3D back a character
> alias __H=3D$(print '\0001') =A0 =A0# ^A =3D home =A0=3D beginning of lin=
e
> alias __W=3D$(print '\0005') =A0 =A0# ^E =3D end =A0 =3D end of line
>
> The Putty help page says:
>
> 4.4.2 Changing the action of the Home and End keys
> The Unix terminal emulator rxvt disagrees with the rest of the world
> about what character sequences should be sent to the server by the
> Home and End keys.
>
> xterm, and other terminals, send ESC [1~ for the Home key, and ESC [4~
> for the End key. rxvt sends ESC [H for the Home key and ESC [Ow for
> the End key.
>
> If you find an application on which the Home and End keys aren't
> working, you could try switching this option to see if it helps.
>
> If my Putty setting is set to xterm, neither Home nor End work - both
> just cause the bell sound (from the ESC [1 and ESC [4 sequence???) and
> display ~ in the terminal.
>
> If my Putty setting is set to rxvt, Home works - the alias defined
> above causes the the cursor to move to the beginning of the line. =A0But
> End causes the bell sound, and displays w in the terminal.
>
> The arrow keys work in both settings.
>
> Questions:
>
> 1) =A0How can I get the End key to move to the end of line? =A0IOW, I nee=
d
> to alias the key sequence (either ESC [4~ or ESC [0w) to Cntl-E.
>
> 2) =A0Where can I find documentation for the syntax in the aliases found
> via Google? =A0IOW I'd like more details on the "__A", "__B", etc. and
> the $(print '\0020'), etc. syntax in the above aliases. =A0If it's in
> the man pages I can't find it. =A0A good web page documenting this would
> be fantastic.
>
> Thanks for the help,
> Scott
1)
From my own experience : you can't.
You can switch to the bash shell if it is available on your system: it
recognizes any keys combination.
ksh88 is only able to recognize "ESC letter" or "ESC [ letter"
sequences.
ksh93 may recognize any key sequence but, after a long work on it, I
wasn't able to manage it to work.
2)
The documentation about the aliases __A, __B *is* in the man pages !
http://www2.research.att.com/sw/download/man/man1/ksh88.html
But very difficult to find !
It's in "Emacs Editing Mode" part:
---------------------------------
M-[letter
Soft-key - Your alias list is searched for an alias by the name
__letter and if an alias of this name is defined, its value will be
inserted on the input queue. The can be used to program functions keys
on many terminals.
---------------------------------
N.B. :
Use the od command to dump the sequences sent by the keys :
After validating "od -cx" command line, I hit
[Home][Return]
[End] [Return]
[Ctrl][D] (to exit "o" command)
$ od -cx
^[[1~
^[[4~
0000000 033 [ 1 ~ \n 033 [ 4 ~ \n
5b1b 7e31 1b0a 345b 0a7e
0000012
|
|
0
|
|
|
|
Reply
|
projXYZZYtools
|
3/18/2010 6:29:57 PM
|
|
|
3 Replies
2715 Views
(page loaded in 0.258 seconds)
Similiar Articles: Mapping home and end keys - ksh and Putty - comp.unix.shell ...Hi, My environment is ksh88 (ugh!) under HP-UX, with Putty as my connection client. I'm trying to remap my arrow, home, and end keys to the ema... remote terminal : function keys do not work - comp.unix.solaris ...Mapping home and end keys - ksh and Putty - comp.unix.shell ... remote terminal : function keys do not work - comp.unix.solaris ... Mapping home and end keys - ksh and ... PuTTY, X, and backspace - comp.unix.solarisMapping home and end keys - ksh and Putty - comp.unix.shell ... PuTTY, X, and backspace - comp.unix.solaris Mapping home and end keys - ksh and Putty - comp.unix.shell ... Difficulty PIX ssh server via Putty. - comp.dcom.sys.cisco ...Mapping home and end keys - ksh and Putty - comp.unix.shell ... Difficulty PIX ssh server via Putty. - comp.dcom.sys.cisco ... You can switch to the bash shell if it ... emacs and PuTTY - comp.emacsMapping home and end keys - ksh and Putty - comp.unix.shell ... Hi, My environment is ksh88 (ugh!) under HP-UX, with Putty as my connection client. Is there a PuTTY command line option for "X display location ...Mapping home and end keys - ksh and Putty - comp.unix.shell ..... this option to see if it helps. If my Putty ... and display ~ in the terminal. VI at the command line and backspace - comp.unix.solaris ...Mapping home and end keys - ksh and Putty - comp.unix.shell ... VI at the command line and backspace - comp.unix.solaris ... Mapping home and end keys - ksh and Putty ... ksh: functions aren't exported? - comp.unix.shellMapping home and end keys - ksh and Putty - comp.unix.shell ..... on which the Home and End keys aren't working ... The can be used to program functions keys on many ... Test regex in KSH - comp.unix.shellMapping home and end keys - ksh and Putty - comp.unix.shell ... ANSI terminal escape sequence regexp - comp.unix.shell All the sequences I've see end in a letter. Terminal emulation, X servers and ssh - comp.sys.hp.hpux ...Mapping home and end keys - ksh and Putty - comp.unix.shell ..... says: 4.4.2 Changing the action of the Home and End keys The Unix terminal emulator ... Mapping home and end keys - ksh and PuttyHi, My environment is ksh88 (ugh!) under HP-UX, with Putty as my connection client. I'm trying to remap my arrow, home, and end keys to the emacs editing Re: Mapping home and end keys - ksh and PuttyOn 10 mar, 20:42, Scott Bass <sas_l_...@xxxxxxxxxxxx> wrote: Hi, My environment is ksh88 (ugh!) under HP-UX, with Putty as my connection client. I'm trying to remap ... 7/20/2012 2:14:10 PM
|