3

You can enable "rxvt" option for putty like this:

enter image description here

I did this and now Home/End/Delete keys are distinguished by the terminal on the remote server, despite $TERM is still xterm.

Can you do the same for SSH?

I mean change the way those keys are sent without changing the $TERM and/or installing new terminfos? I cannot just install new terminfo on the remote server, unfortunately.

Edit:

I will be more specific about the situation:

  • I have a Win 10 machine with Git SDK installed.
  • The git-bash has xterm-256color terminfo
  • there is a remote server, which has QNX 6.5 (32 bit) with "@(#)PD KSH v5.2.14 99/07/13.2" to which I connect via "TERM=xterm ssh user@server -i key.pem"
  • I want my page up/down, home/end, insert/delete keys working there as they work in the git-bash shell

This server has several available terminfos, the most commonly used of those are (I suppose):

# ls -la /usr/lib/terminfo/x
total 34
drwxrwxr-x  2 root      root           4096 Oct 19  2010 .
drwxrwxr-x  7 root      root           4096 Oct 19  2010 ..
-rw-r--r--  1 root      root           2384 Jul 10  2010 xterm
-rw-r--r--  1 root      root           1930 Jul 10  2010 xterm-m
-rw-r--r--  1 root      root           2294 Jul 10  2010 xterm-q
-rw-r--r--  1 root      root           1913 Jul 10  2010 xterms

Other ones available:

# ls -la /usr/lib/terminfo/a/
total 19
drwxrwxr-x  2 root      root           4096 Oct 19  2010 .
drwxrwxr-x  7 root      root           4096 Oct 19  2010 ..
-rw-r--r--  1 root      root           1179 Jul 10  2010 ansi
# ls -la /usr/lib/terminfo/q
total 85
drwxrwxr-x  2 root      root           4096 Oct 19  2010 .
drwxrwxr-x  7 root      root           4096 Oct 19  2010 ..
-rw-r--r--  1 root      root           2295 Jul 10  2010 qansi
-rw-r--r--  1 root      root           2092 Jul 10  2010 qansi-g
-rw-r--r--  1 root      root           2357 Jul 10  2010 qansi-m
-rw-r--r--  1 root      root           2301 Jul 10  2010 qansi-t
-rw-r--r--  1 root      root           2357 Jul 10  2010 qansi-w
-rw-r--r--  1 root      root           1491 Jul 10  2010 qnx
-rw-r--r--  1 root      root           1460 Jul 10  2010 qnx2
-rw-r--r--  1 root      root           1491 Jul 10  2010 qnx4
-rw-r--r--  1 root      root           1758 Jul 10  2010 qnxm
-rw-r--r--  1 root      root           1460 Jul 10  2010 qnxs2
-rw-r--r--  1 root      root           1686 Jul 10  2010 qnxt
-rw-r--r--  1 root      root           1371 Jul 10  2010 qnxt2
-rw-r--r--  1 root      root           1686 Jul 10  2010 qnxt4
-rw-r--r--  1 root      root           1707 Jul 10  2010 qnxtmono
-rw-r--r--  1 root      root           1748 Jul 10  2010 qnxw
-rw-r--r--  1 root      root           1048 Jul 10  2010 qvt101
-rw-r--r--  1 root      root           1033 Jul 10  2010 qvt102
-rw-r--r--  1 root      root           1048 Jul 10  2010 qvt108
# ls -la /usr/lib/terminfo/v
total 53
drwxrwxr-x  2 root      root           4096 Oct 19  2010 .
drwxrwxr-x  7 root      root           4096 Oct 19  2010 ..
-rw-r--r--  1 root      root           1035 Jul 10  2010 vi200-f
-rw-r--r--  1 root      root            972 Jul 10  2010 viewpoint
-rw-r--r--  1 root      root           1035 Jul 10  2010 visual
-rw-r--r--  1 root      root           2384 Jul 10  2010 vs100
-rw-r--r--  1 root      root           1913 Jul 10  2010 vs100s
-rw-r--r--  1 root      root           1388 Jul 10  2010 vt100
-rw-r--r--  1 root      root           1388 Jul 10  2010 vt100-am
-rw-r--r--  1 root      root           1703 Jul 10  2010 vt102
-rw-r--r--  1 root      root           1703 Jul 10  2010 vt102-am
-rw-r--r--  1 root      root           1987 Jul 10  2010 vt102-plus
-rw-r--r--  1 root      root            905 Jul 10  2010 vt52

Despite only wanting to fix my specific case of git-bash TO QNX ssh connection at the moment, I am curious about how to fix the discrepancies of such sort in general.

I had a very similar problem with git-bash TO Solaris in the past as well, despite Solaris run bash (not ksh) and had more terminfos available.

I just really don't want to use Putty, because it is less comfortable for me.

a_girl
  • 287
  • 1
  • 10
  • 1
    What do you mean by "for SSH"? SSH is a protocol and it doesn't care what data it sends. Do you mean the `ssh` command? It doesn't care either. PuTTY is not a do-one-thing-and-do-it-well tool. It works as SSH client *and* as local terminal emulator. The setting in question belongs to the terminal emulator part. If you want the keys to work similarly with `ssh` then you need to configure the local terminal emulator (that provides local tty for `ssh`) to send certain sequences of bytes. What is the local terminal emulator then? What is the local OS in the first place? Please [edit] the question. – Kamil Maciorowski Jul 27 '21 at 17:57
  • @KamilMaciorowski but is editing the question best? Then all the comments from the original question are lost. I suggest that your comment effectively answers the question (with what is essentially a "no", and an explanation why). Then, it would be better for a revised question to be a separate question which gets its own answers and related comments. – TOOGAM Jul 28 '21 at 16:21
  • @TOOGAM Well, in the first place I don't know what the intended question really is. If it is about the `ssh` executable and if we knew the OS and the terminal emulator, then maybe we could answer "yes" (and how to do this). E.g. I use `konsole` in Linux and I can configure it to generate (almost?) any sequence upon Home, End or Delete. I'd like to know the OP's OS and their terminal emulator to hopefully be able to answer "yes". I think this would help them; while "no" – not really. Side note: I don't know what you mean by "all the comments from the original question are lost". – Kamil Maciorowski Jul 28 '21 at 16:44
  • @KamilMaciorowski, I have provided more details. Is this enough for now? – a_girl Aug 01 '21 at 12:31
  • It's better for sure. Considering your setup and my limited knowledge, I cannot directly help you. Hopefully someone else will. I have voted up, this is the best I can do for now. Good luck. – Kamil Maciorowski Aug 01 '21 at 13:02
  • @KamilMaciorowski thanks, I too hope someone knows how to deal with this. – a_girl Aug 01 '21 at 22:25

0 Answers0