Input problem over ssh from Linux reddit / freebsd ---------------------------------------------------------------------- Nyanraltotlapun · 2020-07-10 14:12 Hi. I have long going input problems when connecting to FreeBSD over SSH from my linux machine. Connecting from Manjaro(Arch) linux to FreeBSD 12.1 (just ssh command) Instead of Del Page UP/Down I get ~(in just console) and some weird behavior in different apps. This also screwing up freebsd-update for me. Changing root shell from csh to sh fixed "Delete" button. But Page UP/Down still prints ~ in terminal. I tried using putty from my Linux and get the same behavior. Locale set to ru_RU.UTF-8 on linux and FreeBSD box. ---------------------------------------------------------------------- 12Darius21 · 2020-07-10 14:49 Can you try not setting the locale for a test? Also, which terminal emulator on Linux? What does "echo $TERM" say on FreeBSD when you login? ---------------------------------------------------------------------- brady666 · 2020-07-10 14:53 Someone please correct me if this is a different issue, but are you sshing from a terminal emulator on your Manjaro machine? If so then you might need to add something like "export TERM=xterm" into your shell's configuration file (this is what I used for zsh, I'm not as familiar with csh). Otherwise you might have to download a package on FreeBSD that helps its shell deal with whatever term emulator you're using on Manjaro (for example, I was sshing from a machine through urxvt when I had keyboard issues, and installing a package that was something like rxvt-unicode-terminfo on the machine I was sshing into did the trick. Again I don't know about other terminal emulators). Also, if you are sshing from a terminal emulator, try sshing from a TTY and see if the problem is still there ---------------------------------------------------------------------- rhavenn · 2020-07-10 15:35 Probably just a bash vs. tcsh issue. Your default shell on BSD is more than likely tcsh. My 'tcsh' on Arch does that as well when hitting Page Up / Down or the Del key just on the local terminal. I wouldn't mess with the root users shell, but you can install bash if you want and set your users shell to bash. I don't understand how that is screwing up freebsd-update for you. What are you actually trying to do? ---------------------------------------------------------------------- 12Darius21 · 2020-07-10 15:53 You shouldn't have to set TERM in normal operation because SSH will send the terminal type over for you automatically. It can be an issue if the terminal type you are coming from is unknown to the destination system - but that is pretty rare in practise. ---------------------------------------------------------------------- brady666 · 2020-07-10 15:53 Ah gotcha, that's just one thing I saw people suggest when I ran into this issue the other day ---------------------------------------------------------------------- flatland_spider · 2020-07-10 22:45 I know what you mean, and del, pgUp, and pgDown not being set is normal for FreeBSD. I don't have an answer for you. It hasn't gotten to the point where I want to spend time to fix it, but the links below might be helpful. * https://www.freebsd.org/doc/en/books/faq/compatibility-kbd- mice.html#idp45869944 * https://forums.freebsd.org/threads/delete-key.66976/#post-452208 * https://www.cyberciti.biz/tips/freebsd-how-to-customized-home-del- insert-keys-for-bash-shell.html * https://www.tomica.net/blog/2017/10/fix-delete-key-in-csh-or-tcsh * https://www.freebsd.org/cgi/man.cgi?query=bindkey&sektion=1&manpath= freebsd-release-ports * https://www.freebsd.org/cgi/man.cgi?query=csh&sektion=1&manpath=free bsd-release-ports A quick fix is installing bash or zsh, as others have pointed out. ---------------------------------------------------------------------- Nyanraltotlapun · 2020-07-10 23:52 >Probably just a bash vs. tcsh issue But why then putty gets same problem? >I don't understand how that is screwing up freebsd-update for you. What are you actually trying to do? When freebsd-update show list of changes I cannot "scroll" it, instead I get \~ symbols spammed in console. It is hard to explain, perhaps I will be able to film it somehow. ---------------------------------------------------------------------- Nyanraltotlapun · 2020-07-10 23:59 >What does "echo $TERM" say on FreeBSD when you login? xterm-256color As well as in linux. I think it is transmitted from linux to FreeBSD on ssh login. I tried with "xterm" with same result. >Also, which terminal emulator on Linux? I tried xterm xfce sakura putty ---------------------------------------------------------------------- Nyanraltotlapun · 2020-07-11 00:14 >Can you try not setting the locale for a test? I created test user on Manjaro and test user on FreeBSD with adduser with all defaults - same result (dell key working because of sh for FreeBSD test user, but Page Up/Down is not). ---------------------------------------------------------------------- Nyanraltotlapun · 2020-07-11 00:20 This was really helpful, thank you! ---------------------------------------------------------------------- daemonpenguin · 2020-07-11 01:47 putty isn't a shell, it's a ssh client. They parent poster is saying tcsh interprets the page up/down keys as "~", which is true and it's why your screen is getting messed up. tcsh is the default FreeBSD shell. You can switch to another shell that interprets page up/down keys differently to work around this problem. Bash, for example, will work. ---------------------------------------------------------------------- 12Darius21 · 2020-07-11 02:22 I just re-read your email and I think I understand the problem. Page up and page down won't scroll your terminal - you need to use the scroll widgets in it. They are normal key presses and get passed to whatever app is running in the terminal, the shell doesn't do anything with them so they appear as junk. If you where viewing a file or piped command output in less then it *would* scroll up/down in that content - because the less command understands page up/down. ---------------------------------------------------------------------- rhavenn · 2020-07-11 03:28 Shift + PgUp / PgDn scrolls in tachometer ---------------------------------------------------------------------- oh5nxo · 2020-07-11 08:51 The systems maybe disagree what PageUp and PageDown keys should transmit. Looking at /etc/termcap on FreeBSD, I have here :kN=\E[6~:kP=\E[5~: for xterm. If you say cat -vet locally on your Manjaro and press those keys, what do you see? ---------------------------------------------------------------------- Nyanraltotlapun · 2020-07-11 13:06 ^[[6~^[[5~ ---------------------------------------------------------------------- oh5nxo · 2020-07-11 13:58 Ok, false lead, sorry. I get the same.