NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

/bin/ksh, TERM=rxvt, beginning-of-line and "Home"/"End" keys



I'm been using /bin/ksh as an interactive shell in NetBSD for some time
and almost everything was fine with xterm.
But I have troubles with mrxvt (TERM=rxvt) and keys binding,
for example, with Home and End keys that are assigned to
beginning-of-line and end-of-line functions.

ksh's bind says

  ^A = beginning-of-line
  ^E = end-of-line
  ^X1 = beginning-of-line
  ^X4 = end-of-line
  ^X7 = beginning-of-line
  ^X8 = end-of-line
  ^XF = end-of-line
  ^XH = beginning-of-line

When I press "Home" key, position of cursor is set to a beginning of line
and (!!!) unnecessary ~ (tilde) symbol is added. The same for a End key.
Cursor is moved to the end of line and ~ is added.

^A and ^E work fine.

The same settings in xterm everything works just fine.

With the same setting (bind command in my .kshrc) pkgsrc version of mksh
also works fine both with xterm (TERM=xterm) and mrxvt (TERM=rxvt)
though its "bind" builtin shows a bit different output.

  ^A = beginning-of-line
  ^E = end-of-line
  ^X1 = beginning-of-line
  ^X4 = end-of-line
  ^X7~ = beginning-of-line
  ^X8~ = end-of-line
  ^XF = end-of-line
  ^XH = beginning-of-line

The difference is in ^X7 vs. ^X7~.

Both with ksh and mksh the same commands were run at startup.

        set -o vi-tabcomplete
        set -o emacs
        set -o ignoreeof
        set -o braceexpand
        bind '^I=complete-list'
        bind '^XH'=beginning-of-line
        bind '^XF'=end-of-line
        bind '^[[1'=beginning-of-line
        bind '^[[4'=end-of-line
        bind '^[[7~'=beginning-of-line
        bind '^[[8~'=end-of-line
        bind '^[[3'=prefix-2
        if bind -l | grep delete-char-forward > /dev/null; then
                bind '^[[3~'=delete-char-forward
        elif bind -l | grep delete-wchar_t-forward > /dev/null; then
                bind '^[[3~'=delete-wchar_t-forward
        fi

With bash everything works fine too both in xterm and rxvt.

  beginning-of-line can be found on "\C-a", "\eOH", "\e[1~", "\e[7~", "\e[H".
  end-of-line can be found on "\C-e", "\eOF", "\e[4~", "\e[8~", "\e[F".

Is this a bug in NetBSD's /bin/ksh or I did something wrong?

-- 
Best regards, Aleksey Cheusov.


Home | Main Index | Thread Index | Old Index