siduck/st

Change Color SSH

nanvenomous opened this issue · 2 comments

First thanks for this awesome patchset, it is my favorite one. I'm not sure this is the best place to ask, but my C experience is a bit limited and I'm not sure exactly how to extend st.

It's really cool to be able to hot-reload the terminal colors for every emulator on a machine. I would like to be able to have the same effect but for a terminal in a ssh session to use the .Xresources on the remote machine.
In other words, You could have a terminal open running a local shell that has the color scheme of the local machine, but then another terminal open simultaneously that is ssh'd into a remote box and has the color scheme of that remote machine.
Tell me if I'm wrong but I don't think that's currently possible with any patches I've found to st.

My use case is I always forget I'm ssh'd into a machine and accidentally run a command intended for my local machine on the remote box. I think everyone heard of the gitlab database deletion case.

I think this would really be a feature that is not only very visually appealing, but would also be extremely practical.

siduck commented
reloadst() {
   xrdb -merge ~/.Xresources
  kill -USR1 $(xprop -id $(xdotool getwindowfocus) | grep '_NET_WM_PID' | grep -oE '[[:digit:]]*$') 
}

put this shell function in your shell config i.e bashrc etc

siduck commented

I think this would really be a feature that is not only very visually appealing, but would also be extremely practical.

i think its handy, i personally use it to dynamically change padding of st whenever with / without neovim.

Also you just have to kill -USR1 7349 ( the number is PID ), idk if xdotool will work in your ssh stuff