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 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 jwodder:feature/sensible-editor branch from e351627 to 22bfb0c 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
10 checks passed
Tests Build #20200222.3 succeeded
Tests (Job Docs) Job Docs succeeded
Tests (Job PyPy 3 Linux) Job PyPy 3 Linux succeeded
Tests (Job Python 2.7 Linux) Job Python 2.7 Linux succeeded
Tests (Job Python 2.7 Windows) Job Python 2.7 Windows succeeded
Tests (Job Python 3.5 Linux) Job Python 3.5 Linux succeeded
Tests (Job Python 3.6 Linux) Job Python 3.6 Linux succeeded
Tests (Job Python 3.7 Linux) Job Python 3.7 Linux succeeded
Tests (Job Python 3.7 Mac) Job Python 3.7 Mac succeeded
Tests (Job Python 3.7 Windows) Job Python 3.7 Windows succeeded
@jwodder jwodder deleted the jwodder:feature/sensible-editor branch Feb 22, 2020

This comment has been minimized.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.