atuin icon indicating copy to clipboard operation
atuin copied to clipboard

bug: up arrow still bound with `disable-up-arrow`

Open aslafy-z opened this issue 1 year ago • 7 comments

When using up arrow while executing a command that does not consume stdin, atuin starts up after the command ended even if it was started with disable-up-arrow.

Environment

  • zsh 5.9 (x86_64-pc-linux-gnu)
  • atuin 14.0.1

Reproduction steps

  • eval "$(atuin init zsh --disable-up-arrow)"
  • sleep 5
  • within the 5 seconds, press the up arrow
  • wait for the timer to finish
  • atuin shows

Workaround

Use the manual binding (see https://github.com/ellie/atuin/blob/main/docs/docs/config/key-binding.md#zsh):

export ATUIN_NOBIND="true"
eval "$(atuin init zsh)"
bindkey '^r' _atuin_search_widget

aslafy-z avatar May 10 '23 13:05 aslafy-z

Same thing happens to me. Seems like I cannot disable up arrow interactions. I'm using BASH.

wisewtf avatar May 18 '23 09:05 wisewtf

shoot- i was coming here hoping i could disable up arrow (for now, as im having issues w atuin messing up my terminal at times).

so for now i can offer what ive been doing (as a work around) to disable up arrow. you just manually add the output of atuin init bash to the bottom of your .bashrc , and then comment out the 2x bind commands at the bottom ( the ones for up arrow), reload your bash session and up arrow is no longer bound to atuin (but ctrl+r still is, if you like).

also dont forget to remove or comment out the initial eval "$(atuin init bash)"

as an example here is how the bottom of my .bashrc looks (for now, until atuin get the terminal mess up issue resolved)

image

bob454522 avatar May 18 '23 19:05 bob454522

For the record, I updated OP with my current workaround.

aslafy-z avatar May 19 '23 17:05 aslafy-z

shoot- i was coming here hoping i could disable up arrow (for now, as im having issues w atuin messing up my terminal at times).

so for now i can offer what ive been doing (as a work around) to disable up arrow. you just manually add the output of atuin init bash to the bottom of your .bashrc , and then comment out the 2x bind commands at the bottom ( the ones for up arrow), reload your bash session and up arrow is no longer bound to atuin (but ctrl+r still is, if you like).

also dont forget to remove or comment out the initial eval "$(atuin init bash)"

as an example here is how the bottom of my .bashrc looks (for now, until atuin get the terminal mess up issue resolved)

Thank you for this. Don't know why I didn't think of it sooner.

wisewtf avatar May 23 '23 10:05 wisewtf

by comparing atuin init zsh and atuin init zsh --disable-up-arrow it looks like the keybinding for up-arrow is skipped as described by the option.

eval "$(atuin init zsh --disable-up-arrow)" in ~/.zshrc seems to work as expected for me. Thanks to this issue I now know about --disable-up-arrow :D

salzig avatar Jun 13 '23 09:06 salzig

I had the same issue on v16.0.0 using zsh. I had install atuin using antigen antigen bundle atuinsh/atuin. I remove that and use the recommend documentation export ATUIN_NOBIND="true"; eval "$(atuin init zsh)". Then it worked just fine.

DanielRivasMD avatar Aug 10 '23 19:08 DanielRivasMD

The workaround worked for me using bash as well.

Did delete 1-2 existing atuin lines already on .bashrc that were referring to atuin init bash IIRC

cameronj86 avatar Aug 18 '23 08:08 cameronj86

I'm currently unable to replicate this on either zsh, or on bash

Can anyone who had the issue here confirm if it's still happening?

If so, I'd really appreciate you sharing your shell config file

ellie avatar Feb 16 '24 11:02 ellie

@ellie I still have this issue, version 18.0.2, on a MacBook using zsh. I've added this to the bottom of ~/.zshrc:

# eval "$(atuin init zsh --disable-up-arrow)" (tried this on it's own, did not work)
export ATUIN_NOBIND="true"
eval "$(atuin init zsh)"
bindkey '^r' _atuin_search_widget

But the up arrow is still bound.

Jorrit05 avatar Mar 07 '24 12:03 Jorrit05

@Jorrit05 can you share your entire zshrc please?

Also, please try reducing your zshrc to only what you have shown there, and confirm that the issue still occurs

ellie avatar Mar 07 '24 12:03 ellie

ah well, it works! But only after starting a completely new shell. source ~/.zshrc was not enough apparently. (with my full zshrc file, not just those 3 lines)

Jorrit05 avatar Mar 07 '24 13:03 Jorrit05

ah yes - sourcing does not clear all existing keybindings, only executes what's in your zshrc. So, the previous binding would still have been there

ellie avatar Mar 07 '24 13:03 ellie

I confirm, my steps (found in OP) cannot be reproduced anymore, this issue is now fixed! Thank you for your work on this project!

aslafy-z avatar Mar 11 '24 09:03 aslafy-z