Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Debian's sensible-editor #1469

merged 1 commit into from Feb 22, 2020


Copy link

@jwodder jwodder commented Feb 15, 2020

Debian and derivative distros include a program named sensible-editor that is similar in spirit to Editor.get_editor(), except it also allows the user to make an interactive choice when the relevant envvars are unset:

  • It invokes $VISUAL or $EDITOR if they are defined
  • Otherwise, the program specified in ~/.selected_editor is run. If this file does not exist and input is a tty, the user is shown a list of installed text editors and asked to choose one. The choice is saved in ~/.selected_editor, and then the given program is run.
  • If the file does not exist and input is not a tty, or if the program saved in ~/.selected_editor no longer exists, sensible-editor falls back to nano, then nano-tiny, then vi.

This patch adds sensible-editor to the list of editors considered by Editor.get_editor() so that determining an editor to use on Debian systems works similarly to other programs on Debian.

@davidism davidism force-pushed the feature/sensible-editor branch from e351627 to 22bfb0c Compare Feb 22, 2020
@davidism davidism added this to the 7.1 milestone Feb 22, 2020
@davidism davidism merged commit 0e630d0 into pallets:master Feb 22, 2020
10 checks passed
@jwodder jwodder deleted the feature/sensible-editor branch Feb 22, 2020
Copy link

davidism commented Feb 23, 2020

Meant to target this at 7.1, didn't notice it was on master. Cherry picked in 17cc8d7.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants