Skip to content

Support Debian's sensible-editor#1469

Merged
davidism merged 1 commit intopallets:masterfrom
jwodder:feature/sensible-editor
Feb 22, 2020
Merged

Support Debian's sensible-editor#1469
davidism merged 1 commit intopallets:masterfrom
jwodder:feature/sensible-editor

Conversation

@jwodder
Copy link
Contributor

@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 added this to the 7.1 milestone Feb 22, 2020
@davidism davidism merged commit 0e630d0 into pallets:master Feb 22, 2020
@jwodder jwodder deleted the feature/sensible-editor branch February 22, 2020 19:38
@davidism
Copy link
Member

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.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants