mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-29 06:13:20 +00:00
Make --no-config mode more comfortable (#8493)
* Turn on default bindings for --no-config mode The fallback bindings are super awkward to use. This was called out specifically in #7921, I'm going for the targeted fix for now. * Only change keybindings when interactive That's also when we'd source them normally.
This commit is contained in:
parent
7935b7327e
commit
0bc6a7b2ed
1 changed files with 10 additions and 0 deletions
10
src/fish.cpp
10
src/fish.cpp
|
@ -512,6 +512,16 @@ int main(int argc, char **argv) {
|
|||
if (!opts.no_exec && !opts.no_config) {
|
||||
read_init(parser, paths);
|
||||
}
|
||||
|
||||
if (opts.is_interactive_session && opts.no_config && !opts.no_exec) {
|
||||
// If we have no config, we default to the default key bindings.
|
||||
parser.vars().set_one(L"fish_key_bindings", ENV_UNEXPORT, L"fish_default_key_bindings");
|
||||
if (function_exists(L"fish_default_key_bindings", parser)) {
|
||||
std::vector<std::string> cmd {"fish_default_key_bindings"};
|
||||
run_command_list(parser, &cmd, {});
|
||||
}
|
||||
}
|
||||
|
||||
// Re-read the terminal modes after config, it might have changed them.
|
||||
term_copy_modes();
|
||||
|
||||
|
|
Loading…
Reference in a new issue