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

fix(nu): disable the up-arrow keybinding for Nushell #1329

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 16 additions & 14 deletions atuin/src/command/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,20 +109,22 @@ bind -M insert \e\[A _atuin_bind_up";
event: { send: executehostcommand cmd: (_atuin_search_cmd) }
}
)
)
"#;
const BIND_UP_ARROW: &str = r#"$env.config = (
$env.config | upsert keybindings (
$env.config.keybindings
| append {
name: atuin
modifier: none
keycode: up
mode: [emacs, vi_normal, vi_insert]
event: { send: executehostcommand cmd: (_atuin_search_cmd '--shell-up-key-binding') }
}
)
)
)"#;
const BIND_UP_ARROW: &str = r#"
# The up arrow keybinding has surprising behavior in Nu, and is disabled by default.
# See https://github.com/atuinsh/atuin/issues/1025 for details
# $env.config = (
# $env.config | upsert keybindings (
# $env.config.keybindings
# | append {
# name: atuin
# modifier: none
# keycode: up
# mode: [emacs, vi_normal, vi_insert]
# event: { send: executehostcommand cmd: (_atuin_search_cmd '--shell-up-key-binding') }
# }
# )
# )
"#;
if !self.disable_ctrl_r {
println!("{BIND_CTRL_R}");
Expand Down
2 changes: 2 additions & 0 deletions docs/docs/key-binding.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ eval "$(atuin init zsh)"

You can then choose to bind Atuin if needed, do this after the call to init.

**Nushell Only**: The up-arrow keybinding is disabled by default for Nushell until [#1025](https://github.com/atuinsh/atuin/issues/1025) is resolved.

## <kbd>Ctrl-n</kbd> key shortcuts

macOS does not have an <kbd>Alt</kbd> key, although terminal emulators can often be configured to map the <kbd>Option</kbd> key to be used as <kbd>Alt</kbd>. *However*, remapping <kbd>Option</kbd> this way may prevent typing some characters, such as using <kbd>Option-3</kbd> to type `#` on the British English layout. For such a scenario, set the `ctrl_n_shortcuts` option to `true` in your config file to replace <kbd>Alt-0</kbd> to <kbd>Alt-9</kbd> shortcuts with <kbd>Ctrl-0</kbd> to <kbd>Ctrl-9</kbd> instead:
Expand Down