mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-03 06:41:14 -03: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:
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) {
|
if (!opts.no_exec && !opts.no_config) {
|
||||||
read_init(parser, paths);
|
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.
|
// Re-read the terminal modes after config, it might have changed them.
|
||||||
term_copy_modes();
|
term_copy_modes();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user