Using Visual Studio Code as EDITOR e.g. with sudoedit
4
votes
2
answers
3580
views
I am using Kubuntu 20.04.
When I run
sudoedit /etc/fstab
, VS Code opens to a blank document and the CLI immediately returns (see details below).
If I run export SUDO_EDITOR=nano
, the document opens in the nano editor with the contents of /etc/fstab
as expected.
If I run export SUDO_EDITOR=/snap/bin/code
, it once again opens VS Code with a blank document.
What am I doing wrong? Or is this a bug?
***
kevin@kevcoder00 ~ $ echo $VISUAL
kevin@kevcoder00 ~ $ echo $SUDO_EDITOR
kevin@kevcoder00 ~ $ echo $EDITOR
/snap/bin/code
kevin@kevcoder00 ~ $ sudoedit /etc/fstab
[sudo] password for kevin:
sudoedit: /etc/fstab unchanged
Asked by kevcoder
(515 rep)
Oct 10, 2021, 05:43 PM
Last activity: Oct 11, 2021, 11:34 AM
Last activity: Oct 11, 2021, 11:34 AM