Code Monkey home page Code Monkey logo

Comments (25)

ellie avatar ellie commented on May 23, 2024 11

Edit for googlers:

This is now really easy! Checkout the docs: https://atuin.sh/docs/key-binding#disable-up-arrow

I'd like to suggest you consider getting used to it though. It's possible to use a different filter mode with the up arrow - personally, I use the up arrow to filter searches for the directory, while ctrl-r searches globally.


Unfortunately at the moment it'll be a bit awkward. This is definitely something I'd like to change though!

What shell do you use? You'll basically need to rebind whatever your original history search widget was, after running the Atuin init command

If ZSH, something like this should work:

eval "$(atuin init zsh)"
bindkey "^[[A" history-beginning-search-backward # after the atuin init

and if you're using oh-my-zsh, this

eval "$(atuin init zsh)"
bindkey "^[[A" history-substring-search-up

I think for Bash you'd be good doing something like this, though I don't use Bash very much so I'm not 100% sure

eval "$(atuin init bash)"
bind '"\e[A": history-search-backward'

Ideally I'd like this to be configurable in the Atuin config file, or at the very least with environment variables! I'll see if I can sort that soon

from atuin.

lhl avatar lhl commented on May 23, 2024 9

Just an FYI, since this issue still turns up first on web search when looking to disable the up arrow, for anyone looking to do this, the key binding doc (updated location) https://atuin.sh/docs/key-binding has proper recipes for setting this up in zsh, bash, and fish

from atuin.

Laura7089 avatar Laura7089 commented on May 23, 2024 7

For anyone looking at this before fixes in the future, I've saved the output of atuin init zsh to a file that gets loaded by sheldon and just commented out the following lines in the final function of the file:

bindkey '^[[A' _atuin_search_widget
bindkey '^[OA' _atuin_search_widget

This seems to work pretty perfectly for me. If you don't want to use sheldon, you could do something like:

  1. atuin init zsh >> ~/.atuininit.sh
  2. Comment out/remove the lines as above
  3. Add source ~/.atuininit.sh to your .zshrc

from atuin.

Lantianyou avatar Lantianyou commented on May 23, 2024 5

official support, in .zshrc, use eval "$(atuin init zsh --disable-up-arrow)"

from atuin.

Flimm avatar Flimm commented on May 23, 2024 5

Tip for those finding this on Google: if you would like to select a command without running it (similar to the default behaviour of the up arrow in the shell), then press the tab key.

from atuin.

emyller avatar emyller commented on May 23, 2024 2

No new files, simpler version thanks to #62:

ATUIN_NOBIND=t antibody bundle ellie/atuin  # Could be any zsh plugin loader or atuin init
bindkey '^[[A' history-substring-search-up
bindkey '^r' _atuin_search_widget

from atuin.

lhl avatar lhl commented on May 23, 2024 1

I've updated my comment to the new doc location in case people don't make it down here...

from atuin.

ellie avatar ellie commented on May 23, 2024 1

Funnily enough, before we added that, people said the same thing about the opposite behaviour 🤣

Was this issue how you found out about it?

I've tried to put the "tab to edit, enter to exec" thing everywhere, but still get a tonne of people missing it. Do you have any suggestions as the where else it could go?

from atuin.

ellie avatar ellie commented on May 23, 2024 1

Fwiw it's currently

  1. At the top of the README
  2. At the top of the atuin window
  3. In the install section of the docs
  4. In the key controls section of the docs

Maybe a popup on first use too?

from atuin.

rseymour avatar rseymour commented on May 23, 2024 1

I found out via the issue, and I'm not surprised it's contentious. :) I was just searching trying to figure out how to edit a command, which is usually why I use up arrow, ctrl-r is (usually) for finding something I'd already ran correctly, but not always. Since these keystrokes often have years of muscle memory behind them, folks get very "i'm right!!!" about them, so it's best to just force the users to pick.

Popup on first use (like byobu does with ctrl-a, using this helper program: https://linux.die.net/man/1/byobu-ctrl-a) seems like the most usable thing. Thanks for your work!

(to be clear I'd almost say popup on first up arrow, popup on first ctrl-r, but give the user the option to pick the defaults ie 'bash like' to skip later popups and ease into atuin style later)

further parenthetical: I'm trying atuin for the history sharing/db stuff not for any UI improvements, I'm old and fine with the old ways of getting through my history, for now. :)

from atuin.

ellie avatar ellie commented on May 23, 2024 1

Totally makes sense, thanks for the input! Will see about a popup.

further parenthetical: I'm trying atuin for the history sharing/db stuff not for any UI improvements, I'm old and fine with the old ways of getting through my history, for now. :)

Good to hear!

from atuin.

philipp-schmidt avatar philipp-schmidt commented on May 23, 2024 1

I was just searching trying to figure out how to edit a command, which is usually why I use up arrow, ctrl-r is (usually) for finding something I'd already ran correctly, but not always.

+1 @rseymour.

The CTRL-R overlay is great, the sync is awesome, I found the TAB key by myself (didn't notice the hint though). Thanks for the work you put into this @ellie!

But I really struggle with the up-arrow keybind for two reasons:

  • Most common case for up-arrow is a typo or mistake in the last command. With atuin I now have one additional keypress (TAB) before I can correct it, and a "visual interruption" with the overlay popping up briefly
  • While in the up-arrow overlay I can no longer see the output of my last commands, which makes it harder to spot where the mistake in the command was without pressing TAB on a bunch of them to get out of the overlay

This is obviously very opinionated, therefore I deactivated up-arrow. It would be helpful if the bash documentation (https://docs.atuin.sh/configuration/key-binding/#bash) would say that .bashrc has to be edited for this to work. Took me a moment to figure out what to do with the docs there. Leaving this here in case anyone coming from google has to change it in bash.

Replace

eval "$(atuin init bash)"

with

export ATUIN_NOBIND="true"
eval "$(atuin init bash)"
bind -x '"\C-r": __atuin_history'

in .bashrc to disable up-arrow keybind.

from atuin.

philipp-schmidt avatar philipp-schmidt commented on May 23, 2024 1

@ellie

inline_height is perfect, thank you so much! I put it in ~/.config/atuin/config.toml and so far that works persistent across sessions.

from atuin.

hardyrarso avatar hardyrarso commented on May 23, 2024

@lhl Thank you so much for mentioning this!

from atuin.

Blizzke avatar Blizzke commented on May 23, 2024

Figured this is still a part of the question, but when using eval "$(atuin init zsh --disable-up-arrow)" in my .zshrc, I'm getting a :

error: Found argument '--disable_up_arrow' which wasn't expected, or isn't valid in this context

(atuin 12.0.0)

I've tried

from atuin.

scottwarren avatar scottwarren commented on May 23, 2024

Just an FYI, since this issue still turns up first on web search when looking to disable the up arrow, for anyone looking to do this, the key binding doc https://github.com/ellie/atuin/blob/main/docs/key-binding.md has proper recipes for setting this up in zsh, bash, and fish

Above has changed (now a dead link), new location in the web: https://atuin.sh/docs/config/key-binding

EDIT: config change from eval "$(atuin init zsh)" to eval "$(atuin init --disable-up-arrow zsh)" assuming you run ZSH

from atuin.

tomchiverton avatar tomchiverton commented on May 23, 2024

Just an FYI, since this issue still turns up first on web search when looking to disable the up arrow, for anyone looking to do this, the key binding doc https://github.com/ellie/atuin/blob/main/docs/key-binding.md has proper recipes for setting this up in zsh, bash, and fish

This link is a 404

from atuin.

ellie avatar ellie commented on May 23, 2024

Just an FYI, since this issue still turns up first on web search when looking to disable the up arrow, for anyone looking to do this, the key binding doc https://github.com/ellie/atuin/blob/main/docs/key-binding.md has proper recipes for setting this up in zsh, bash, and fish

This link is a 404

There's a page on our docs all about key bindings: https://atuin.sh/docs

from atuin.

rseymour avatar rseymour commented on May 23, 2024

The tab for enter thing was driving me mad, I had no idea how to edit the commands atuin was showing me, just rerun them. I was very close to uninstalling. the grayed out top keystrokes should be less grayed out and at the bottom where the users' eyes are. (imo)

from atuin.

ellie avatar ellie commented on May 23, 2024

While in the up-arrow overlay I can no longer see the output of my last commands, which makes it harder to spot where the mistake in the command was without pressing TAB on a bunch of them to get out of the overlay

Setting inline_height = 30 or something like that might work for you there? It stops the TUI from taking the whole screen

Otherwise, generally this section of the docs should be referred to for disabling the up arrow

https://docs.atuin.sh/configuration/key-binding/#disable-up-arrow

so

eval "$(atuin init bash --disable-up-arrow)"

That way you won't need to rebind anything yourself :)

I'll try making the docs clearer

from atuin.

philipp-schmidt avatar philipp-schmidt commented on May 23, 2024

Actually I tried that command first (replacing zsh with bash felt straightforward), but it didn't work for me. I didn't debug it any further though.

Thanks for the pointer to inline_height, I will give it a go :)

from atuin.

rseymour avatar rseymour commented on May 23, 2024

I tried the inline height change but uninstalled completely after the eval wasn't sticky between shell instantiations. I may try again now knowing it needs to done per instance. I'd love to have a "zero messing with my UI" atuin install option, and still get the stats and sharing.

from atuin.

ellie avatar ellie commented on May 23, 2024

completely after the eval wasn't sticky between shell instantiations

what do you mean? you need to put it in your .zshrc/.bashrc/etc

I'd love to have a "zero messing with my UI" atuin install option

#798 may have what you want

from atuin.

rseymour avatar rseymour commented on May 23, 2024

The diff between config atuin and the shell run control file isn't clear in the docs. I thought running the eval changed an atuin config globally. The docs just say shell but not the file(s) you may want to edit to keep it persistent across sessions.

from atuin.

ellie avatar ellie commented on May 23, 2024

@ellie

inline_height is perfect, thank you so much! I put it in ~/.config/atuin/config.toml and so far that works persistent across sessions.

excellent! glad to hear it worked for you 🙏

from atuin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.