DEV Community

Discussion on: TIL: Integrate Visual Studio Code with Shell / CLI

jonasbn profile image
jonasbn Author

I made a little experiment this morning, exchanging $EDITOR for $VISUAL and it works as expected.

I guess the recommendation should be to use $VISUAL for you GUI enabled editor and then define $EDITOR point to a non-gui like vi, nano, vim or similar for hosts where you access via ssh.

Which makes your shell configuration portable, which holds a lot of benefits.

So I ended up with the following:

VISUAL='code --wait --new-window'


Thanks for the pointer. I do however wonder where this is documented, would love to know a know authoritative resource. I will update my TIL accordingly.

tux0r profile image
tux0r • Edited on

Parts of the definition come from POSIX. Even in 2018 when most operating systems skip large parts of POSIX, it could be useful to stick to its recommendations.

Glad to help.

Thread Thread
jonasbn profile image
jonasbn Author

I find your recommendation much more correct, the more I think about it - thanks again.

My .bash_profile has followed me for many years, glad to learn that I can still improve it.