Live data from Hacker News

SSH-tools: Making SSH more convenient

github.com

11–20 of 37 posts

Re: SSH-tools: Making SSH more convenient

#11

One thing I wish ssh would make easier is terminfo. I have moved from using xterm as my daily terminal emulator to kitty. The only complaint I have is when I ssh around, I need to copy the terminfo to the remote system (kitty does not use TERM="xterm-256color" because it is not 100% compatible). Kitty does have a ssh wrapper which can copy the terminfo for me, but I rarely remember to use it. And it doesn't work for…

Because of my experience with Kitty I agree this is a little bit of a pain point which could use some TLC by all parties involved. However, kitty seems to occupy a unique position on this and although it has intriguing ideas does not seem to have many tools needing the same accommodations. Iterm and wezterm both just use xterm-256color perhaps because there’s no better options. I just tested the setEnv ssh_config option others mentioned and that seems a good workaround. It is a bit confusing to have to set that but doing so avoids overriding the kitty.conf setting which is very strongly discouraged. It would be ideal to only set that when using kitty to make an ssh connection but since all my other tools use it anyway it isn’t a major issue.

I think my biggest pain points with SSH are more related to sessions and tools. I can easily navigate to servers but it’s a bit of a pain when I have to use certain users to log in and then others to operate on data on those servers. VSCode has good ssh support if you are able to log in as the same user as the user that has edit permissions on the files you need to modify. Wezterm ssh and iTerm tmux integration have also given me trouble when I want to open a new pane after I’ve run su or sudo. I end up having to use workarounds like changing permissions while I edit and changing back or simply avoiding the feature altogether because I’m already on the server and didn’t remember to connect with the right command or didn’t start tmux before I started work.

Re: SSH-tools: Making SSH more convenient

#12
post #7

Learning a little vim (i.e. how to open multiple buffers and tabbing between them) as well as learning a little tmux and a little htop has made my experience with ssh way more palatable.

+1 to learning a little bit of Vim, but I'd say buffers aren't necessary to get a passable experience. At least for casual SSH purposes.

Never been able to get the hang of tmux though. I know it's super powerful but I feel like in constantly fighting it. Though even just screen for keeping multiple console sessions alive at a time is super helpful even if I only use one at a time.

Re: SSH-tools: Making SSH more convenient

#13
post #9

Earlier quoted context omitted.

Fellow Kitty user here, similar hurdles. If you haven't implemented it in your workflow already, you can conditionally set TERM for hosts in your SSH configs with SetEnv. This is one of the few, if not the only, variable that SSHd will allow clients to set for free.

What does your last sentence mean? What is the "cost" for setting other vars?

There are only a few environment variables allowed to be set by an SSH client by default. You can add more by adding an "AcceptEnv" line to the SSH server "/etc/sshd_config" file.

Re: SSH-tools: Making SSH more convenient

#14

One thing I wish ssh would make easier is terminfo. I have moved from using xterm as my daily terminal emulator to kitty. The only complaint I have is when I ssh around, I need to copy the terminfo to the remote system (kitty does not use TERM="xterm-256color" because it is not 100% compatible). Kitty does have a ssh wrapper which can copy the terminfo for me, but I rarely remember to use it. And it doesn't work for…

Also kitty user here, and one thing I really missed about xterm is the ability to "InhibitTite" to disable the second buffer. Use case: I edit a documentation file, find a set of commands I need to run, and exit the editor to run them, and the commands disappear from my screen. xterm has a few options allowing you, as the user, to disable this functionality and just have a single screen.

Most other terminals do not have this option.

So for kitty, I made a small deb package with the kitty terminfo file, which I need anyway unless I use xterm-256color, but I modified the entry to not have the ti/te entries.

Win/win.

Re: SSH-tools: Making SSH more convenient

#15
post #7

Learning a little vim (i.e. how to open multiple buffers and tabbing between them) as well as learning a little tmux and a little htop has made my experience with ssh way more palatable.

I recently went through a whole big tooling push where I switched from neovim with a set of configs and plugins I've been pulling along for a decade or two, to (eventually) LunarVim and mostly the stock config.

But, in screen LunarVim and kakoune and other editors I was playing with were totally jacked. So I finally made the switch to tmux and oh-my-tmux.

htop is good, but check out btop. https://github.com/aristocratos/btop

Re: SSH-tools: Making SSH more convenient

#16
post #7

Learning a little vim (i.e. how to open multiple buffers and tabbing between them) as well as learning a little tmux and a little htop has made my experience with ssh way more palatable.

+1 to learning a little bit of Vim, but I'd say buffers aren't necessary to get a passable experience. At least for casual SSH purposes. Never been able to get the hang of tmux though. I know it's super powerful but I feel like in constantly fighting it. Though even just screen for keeping multiple console sessions alive at a time is super helpful even if I only use one at a time.

For me, getting value out of tmux required some significant overrides of the default configs, and knowing where to start was super daunting for me. From a HN post a few years back, I started installing the Noobs Term (https://noobs-term.com) defaults on any new system that I install. This suite of defaults does a lot of things, including installing nvim over vim, an opinionated zsh config with oh-my-zsh set of defaults and a quite nice tmux config, making it easy and reasonable to create new tabs and panes, swap between them and navigate around. With this, tmux quickly went from chore to pleasure to use.

Re: SSH-tools: Making SSH more convenient

#17
post #9

Earlier quoted context omitted.

Fellow Kitty user here, similar hurdles. If you haven't implemented it in your workflow already, you can conditionally set TERM for hosts in your SSH configs with SetEnv. This is one of the few, if not the only, variable that SSHd will allow clients to set for free.

What does your last sentence mean? What is the "cost" for setting other vars?

As others have pointed out - security restriction.

The service must allow most variables to be set by connecting clients.

If TERM were included in this, you might as well install the terminfo! Fortunately that's not the case.

One could do some interesting things if say SHELL or LDPRELOAD were allowed to be forwarded.

Re: SSH-tools: Making SSH more convenient

#18

Earlier quoted context omitted.

+1 to learning a little bit of Vim, but I'd say buffers aren't necessary to get a passable experience. At least for casual SSH purposes. Never been able to get the hang of tmux though. I know it's super powerful but I feel like in constantly fighting it. Though even just screen for keeping multiple console sessions alive at a time is super helpful even if I only use one at a time.

For me, getting value out of tmux required some significant overrides of the default configs, and knowing where to start was super daunting for me. From a HN post a few years back, I started installing the Noobs Term ( https://noobs-term.com ) defaults on any new system that I install. This suite of defaults does a lot of things, including installing nvim over vim, an opinionated zsh config with oh-my-zsh set of defa…

I went with oh-my-tmux, and added a few plugins for copy-pasting in the buffer, and now I'm wishing I had that ability in my kitty term as well. I can hit a couple hot-keys and get quick copy/paste access to: git revisions, file paths, words, or any random start/stop letters on the screen. Using the plugins extrakto, tmux-copy-toolkit, and tmux-copycat.
Post reply on HN