SchoofsKelvin / vscode-sshfs

Extension for Visual Studio Code: File system provider using SSH
GNU General Public License v3.0
546 stars 36 forks source link

Terminal colors dont work & show weird characters (fish shell) #299

Closed tennox closed 2 years ago

tennox commented 2 years ago

Have a fresh raspbian/debian with fish shell: Screenshot from 2021-10-15 15-26-31

SchoofsKelvin commented 2 years ago

What does echo $TERM output, and is this different from when you're connecting to your server outside VS Code?

Did you also add -CHECK_HOME to your flags? Using fish as login shell should error right now about not finding the home directory (fish doesn't support backticks for command substitution, which I use for this). I'm actually working on a way to support a lot more shells, which will help with this. This is separate from the weird characters/colors though.

EDIT: After another quick look, it seems to be that the underlying ssh2 library (or OpenSSH itself) uses vt100 as the default $TERM which leads to this weird behavior. As a quick fix, you could try running TERM=xterm $SHELL or even making that your Terminal command. This should make fish act as normal. In the meantime I'll look into what the best $TERM is based on what VS Code's terminal UI supports, and override the $TERM environment variable with that in the future.

psolyca commented 2 years ago

To get color and get ride of this vt100 terminal, I have used the new environment variable in my config. I did not find it quickly as not documented but it is discussed in this issue #241 (and commit https://github.com/SchoofsKelvin/vscode-sshfs/commit/3109e977a5ac068aac6cf9081cfcc6c5b655de2f). Add "environment": {"TERM":"xterm"} or xterm-256color to your server configuration.

tennox commented 2 years ago

Yep, inside VSCodium it's vt100 and the suggestion of @psolyca fixed the issue :+1:

Thanks also for the tip about "sshfs.flags": ["-CHECK_HOME"] :+1: it removes the warning I had to ignore each time :yum:

SchoofsKelvin commented 2 years ago

Seems like the integrated terminal has full xterm-256color support, so I'll be setting that as an environment variable, once I've dealt with the home directory detection for fish failing.

SchoofsKelvin commented 2 years ago

Fixed in 554eda8, which will be in the next release (v1.23.2 or later), sets $TERM to xterm-256color which should work for all shells. Tested by using fish as login shell and by running tmux with bash as login shell, along with simply echo $TERM.

SchoofsKelvin commented 2 years ago

Released in v1.24.0 of the extension.