-
Notifications
You must be signed in to change notification settings - Fork 557
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
Add alternate_editor config option to specify an editor. #1350
base: main
Are you sure you want to change the base?
Conversation
I use gvim. Gvim has a slighltly strange functionality where it immedietly forks when run. This means it isn't functional for use with the \e command. By allowing the user to select a different editor they can use some other editor without changing their VISUAL variable they can for example set the config option to 'gvim --nofork' to get the desired functionality.
@j-bennet can you check this pr when it's convenient. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine, except I'd leave the config option empty, instead of default
.
# When set to a non default value, the chosen editor will be used when opening an | ||
# editor with \e. Otherwise, if default is selected, the enviroment variable VISUAL | ||
# is used. If VISUAL is blank then enviroment variable EDITOR is used. | ||
alternate_editor = default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why default
and not just leave it empty?
@bossstein Do you plan to continue working on this PR? |
Description
Solution to issue #1342 . This change adds an
alternate_editor
config option. Previous functionality was to check the $VISUAL environment variable and use this and then if this is blank it would use $EDITOR. These environment variables are used by other software and as such a user may not want to change them, however they may want to not use a visual editor in pgcli or they may want to use a different editor to the default. By adding this alternate editor option a user can choose a different editor and even specify arguments if they want to use different editor behaviour while in pgcli.Checklist
changelog.rst
.AUTHORS
file (or it's already there).pip install pre-commit && pre-commit install
), and ranblack
on my code.