Terminal emulator/xterm/stty confusion: trying to get Ctrl-Backspace behaving like GUI-native apps

I think they are confused because you are running PopOS and Manjaro. It was not clear to me at first that your were running them headless, or at least just using an SSH session to the tty. With that said, if the system is not running headless on the back end, then that could be a possible issue. But you seem to be sure that they are headless, so I would just ignore that bit. But, do you know if they are running any logon manager like KDM, GDM, LightDM, and etc? If so, there there is a basic part of the DE that is still handling input.

In General, I think you are on the right path, as I had mentioned, you would need to recompile your terminal emulator (in this case PuTTY > xterm emulation) to get your desired output since I believe you are fighting a Unix-like-ism, where CTRL is handled differently than MS Windows (and maybe OSX, because reasons).

I agree, I think there is definitely room for miscommunication in a post this large. I did have the OS, PuTTY, xterm, and showkey -a results all within 2 sentences as quoted though, right below a section header “What I have tried & learned”. I am sure, in the least, that Amazon Linux is headless, and provides the same terminal emulator response over the same PuTTY configuration.

I’ll have to look into the logon manager. I’m running most things stock, as pitched by the main links on the distribution’s site, so Pop!_OS is running Gnome & GDM3, and Manjaro Xfce, but is powered off at the moment so I’m not sure which login manager it ships with.

Still, the last few days of using AHK to override the hotkey sent only when I have PuTTY open has been working very seamlessly. I’ll keep checking this post and replying because I really would like to learn more about this chain of communication, and I don’t mind doing research and running tests to get there. That said, I’m kind of at a dead end with my own knowledge about terminal emulators, especially as it concerns the handling of key combinations, which is why I’m here; I’m hoping someone knows something about this that can either teach me directly or point me in the right direction.

Clearly something is weird here on the chain in between my keyboard and the results of Ctrl-V or showkey -a (which both return the same results in every test I have run), yet local WSL returns what is expected, so I would even limit the scope to the application making the connection to the server, and the server running the keystroke to stdout application. I think what’s left here is: PuTTY (and its potential configuration options), xterm (terminal emulator, including xterm configs), and that’s about it. Are there any other links? I think the DE or login manager is not one, when operating over SSH, since I get the same results xterm environment variable on Amazon Linux which has no file at /etc/X11/default-display-manager.

I think you are pretty much spot on at this point.

Hah! I just noticed that the integrated terminal in VSCode works as expected, though I figured I would have to reconfigure it. I’m working on a remote session to the same machines mentioned previously. It seems like they’ve programmed Ctrl-Backspace as Ctrl-W by default! Now my solution using AHK to correct PuTTY behavior is feeling really correct, since this is how it has been implemented in other/newer SSH clients as well!

2 Likes