We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 801a228 commit 97090d7Copy full SHA for 97090d7
editor.py
@@ -50,10 +50,12 @@ def get_platform_editor_var():
50
51
52
def get_editor():
53
- env_editor = os.path.expandvars('$EDITOR')
54
- if env_editor != '$EDITOR' and env_editor.strip():
55
- return env_editor
+ # Get the editor from the environment. Prefer VISUAL to EDITOR
+ editor = os.environ.get('VISUAL') or os.environ.get('EDITOR')
+ if editor:
56
+ return editor
57
58
+ # None found in the environment. Fallback to platform-specific defaults.
59
for ed in get_default_editors():
60
path = find_executable(ed)
61
if path is not None:
0 commit comments