Code Monkey home page Code Monkey logo

Comments (5)

martinetd avatar martinetd commented on June 2, 2024 1

Having the same problem here on linux/us layout with multiple terminals/shells (including tty!), so it's not just macs -- upon further digging it looks like it's a feature; for example xterm's code:
https://github.com/xterm-x11/xterm-snapshots/blob/master/input.c#L267

 * X "normally" has some built-in translations, which the user may want to
 * suppress when processing the modifyOtherKeys resource.  In particular, the
 * control modifier applied to some of the keyboard digits gives results for
 * control characters.
 *
 * control 2   0    NUL
 * control 3   0x1b ESC
 * control 4   0x1c FS
 * control 5   0x1d GS
 * control 6   0x1e RS
 * control 7   0x1f US
 * control 8   0x7f DEL

So ctrl-3 is escape, that'd close the search interface alright...

Looking at showkey -a output it's also easy to confirm the keys atuin can see are ambiguous, so there's not much that can be done here... Apparently some terminals can be configured to override which key is sent, but that's not obvious, will be a battle everytime you change term, and I'm not quite sure what character would be appropriate to send in the first place anyway!

Since I cannot use alt for this (taken up by my window manager), I'd be tempted to suggest other alternatives (shift-number, F keys, first row...) -- but that'll depend heavily on the keyboard layout, perhaps it'd be simpler to just let users bind each key individually?

The code in atuin/src/command/client/search/interactive.rs is currently a big match switch that's a tad unwieldy to customize but I guess it'll be an investment that pays off for everyone who isn't on us layout as well.
(If using alt I'd also consider allowing escape to not close the interactive view, as escape+digit could acts as alt (meta), but that doesn't look possible to disable right now either)

Until then, we can just ignore the pretty numbers on the left! :p

from atuin.

wllenyj avatar wllenyj commented on June 2, 2024

In my macOS, iTerm2 3.4.23.
ctrl+1, ctrl+2, ctrl+3, ctrl+8, ctrl+9 can't work, the others are OK.

ctrl+1 and ctrl+9 will print 1 and 9.
ctrl+2 print the space.
Pressed ctrl+3, search UI will exit. But the result don't display to prompt.
Pressed ctrl+8, nothing happen.

from atuin.

ellie avatar ellie commented on June 2, 2024

Do you have any bindings setup? iTerm often has a bunch of shortcuts defined in its keys settings.

Also - what keyboard layout are you using?

from atuin.

wllenyj avatar wllenyj commented on June 2, 2024

There are Key Mappings in iTerm2 as follow.
image

from atuin.

Samasaur1 avatar Samasaur1 commented on June 2, 2024

I'm also having issues. I have a lot of terminals on my Mac, so I tested in all of them:

  • kitty: ctrl-1 and ctrl-2 insert 1 and 2, respectively, in the search bar. ctrl-3 exits atuin but puts nothing on my prompt. ctrl-4 through ctrl-7 work as expected. ctrl-8 does nothing. ctrl-9 inserts 9
  • hyper: ctrl-1 and ctrl-2 do nothing. ctrl-3 exists atuin but puts nothing on my prompt. ctrl-4 through ctrl-7 work as expected. ctrl-8 and ctrl-9 do nothing
  • wezterm: ctrl-1 inserts 1. ctrl-2 inserts space. ctrl-3 exits atuin but puts nothing on my prompt. ctrl-4 through ctrl-7 work as expected. ctrl-8 does nothing. ctrl-9 inserts 9
  • tabby: ctrl-1, ctrl-2, ctrl-8, and ctrl-9 do nothing. ctrl-3 exits atuin but puts nothing on my prompt. ctrl-4 through ctrl-7 work as expected
  • iterm2: ctrl-1 inserts 1. ctrl-2 inserts space. ctrl-3 exits atuin but puts nothing on my prompt. ctrl-4 through ctrl-7 work as expected. ctrl-8 does nothing. ctrl-9 inserts 9
  • cool-retro-term: none of the ctrl-n keys do anything
  • alacritty: ctrl-n inserts n (e.g., ctrl-1 inserts 1, ctrl-2 inserts 2, etc.)

I don't actually use most of these terminals, so I doubt that it's my config that's the issue.

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.