rocky/shell-term-background

Export LC_DARKMODE

sscherfke opened this issue · 1 comments

You can automatically pass environment variables from an SSH client to an SSH server, e.g. the DARK_BG variable, to allow a vim on the server to set the correct background. (See https://serverfault.com/questions/482907/setting-a-variable-for-a-given-ssh-host)

However, variables must be explicitly whitelisted in the servers /etc/ssh/sshd_config. By default, some Linux' allow only LC_* (others are even more restrictive).

I suggest to additionally export LC_DARKMODE=[1|0] so this variable can be sent to remote servers without addional configuration of the remote host.

rocky commented

Thanks. This is a good idea. Please double check c65e421 though. I make a lot of mistakes.

However I've leftDARK_BG for now since I use this code and it will take a while for me to convert my uses. Also, I have a small preference for LC_DARK_BG over LC_DARKMODE since, at least to me, it is more descriptive: it is the background that is dark.

I used to have variables like DARK_LS_COLORS and I could never remember if that meant that the forground or the background was the thing that was dark. Although LC_DARKMODE is clearer, I have a little bit of hesitancy in making the connection that this is a dark terminal theme. I suppose a longer variable name like DARK_LC_TERMINAL_THEME make that clearer, but for me, LC_DARK_BG is fine.