gemini-cli icon indicating copy to clipboard operation
gemini-cli copied to clipboard

windows CTRL + A for selecting all user input

Open nylla8444 opened this issue 1 year ago β€’ 18 comments

What would you like to be added?

A function that selects all user input via CTRL + A

Why is this needed?

There are instances that users need to select all typed information. Example: Instead of manually deleting/backspacing user input, it would be best if users can just press CTRL + A to select all and delete

Additional context

Didnt saw it in issues list so might good to add this. Image

nylla8444 avatar Jul 12 '25 06:07 nylla8444

I concur. Tip for now: check your chats in: ~/.gemini/tmp/.../logs.json

  • they may be there, especially after some crash.

Manamama avatar Jul 12 '25 08:07 Manamama

I solved a related problem here: https://github.com/Manamama/Puzzles_for_AIs/tree/main/docs/pmbok_instructions/code/Gemini%20CLI%20logs%20prettifier, try using that method to retrieve chats.

Manamama avatar Jul 12 '25 11:07 Manamama

I solved a related problem here: Manamama/Puzzles_for_AIs@main/docs/pmbok_instructions/code/Gemini%20CLI%20logs%20prettifier, try using that method to retrieve chats.

why are we talking about chat retrieval now here?

isnt my issue about CTRL + A functionality? Im confused, did I miss something @Manamama ?

nylla8444 avatar Jul 12 '25 12:07 nylla8444

Also, if possible, I will work on this feature by myself.

Idk who to ask for permissions

nylla8444 avatar Jul 12 '25 12:07 nylla8444

Ah, I misunderstood you: I thought you wanted to somehow mark all chat window via some keys combination. Ok, just ignore mine then. FYI, if only in the input field, I just use the terminal combination: Ctrl+W, which takes about a second to delete all in the input field.

Manamama avatar Jul 12 '25 12:07 Manamama

CTRL + W does not even work when currently running gemini @Manamama .

That should be another issue too but yeah

nylla8444 avatar Jul 12 '25 14:07 nylla8444

"It works on my device":

https://github.com/user-attachments/assets/687ea832-aebf-4f50-aed0-7c9f7a722227

plus: "your mileage may vary".

Manamama avatar Jul 12 '25 15:07 Manamama

for some reason, it works now. Thanks man

nylla8444 avatar Jul 12 '25 17:07 nylla8444

If someone implements this I would welcome the contribution. Tag me in the pull request and I'll prioritize reviewing it.

jacob314 avatar Jul 17 '25 20:07 jacob314

hi @jacob314

I'd be happy if this will become my very first contribution. I will make a PR later this day.

nylla8444 avatar Jul 18 '25 00:07 nylla8444

Great! Please tag me when you have something ready for my review.

jacob314 avatar Jul 18 '25 01:07 jacob314

@jacob314 after reading the code I found that there is a current binding to CTRL + A shortcut which is Move to beginning of line

So I can not use CTRL + A for Select All. what keybind shortcut would you recommend here?

nylla8444 avatar Jul 18 '25 02:07 nylla8444

Why not use "Home" to get to the beginning of the line and have Ctlr+A to select all if you want to add it at all. However I don't see this as super practical addition, the select all is probably mostly used to either copy or delete the input, can't think of any other scenario. Just add bindings to these exact options instead of struggling with selection. Add binding for "Copy input" and for "Clear input" if not present.

Now when it comes to copying stuff, I feel the issue is wider than just the input. It would be useful to have a dedicated in chat command that can also copy any previous message by either the id (would be nice to be able to use negative ids to go from the last) or/and display a small tag next to each message with its ID (number) that allows to do /copy #123 . If there's no such feature planned or worked on yet, then it would be useful. It's more useful to copy output messages than input messages in general.

What do you guys think?

FYI @jacob314

laelhalawani avatar Jul 18 '25 03:07 laelhalawani

i will wait for the feedback first. will pause my development

nylla8444 avatar Jul 18 '25 03:07 nylla8444

I also suggest we wait. I still do not understand the problem. Most of the below work even in Termux, with my two grubby fingers there: https://github.com/Manamama/Ubuntu_Scripts_1

Let me repaste these for now only. BTW, Gemini CLI (or was it Grok AI?) collated them from three Helps etc., so caveat Gemini's brains if it had done rightly so:


πŸ“œ Core Bash shortcuts (work in any terminal)

Ctrl + A β†’ Move to beginning of line

Ctrl + E β†’ Move to end of line

Ctrl + U β†’ Delete from cursor to start of line

Ctrl + K β†’ Delete from cursor to end of line

Ctrl + W β†’ Delete the word before cursor

Ctrl + Y β†’ Yank (paste) what you just cut with Ctrl+U/K/W

Ctrl + L β†’ Clear screen (same as clear)

Ctrl + C β†’ Send SIGINT to stop current command/process

Ctrl + Z β†’ Send SIGTSTP to suspend current process to background

Ctrl + R β†’ Reverse search through command history

Ctrl + D β†’ Log out of terminal (or send EOF)

Ctrl + T β†’ Transpose (swap) two characters around cursor

Ctrl + _ β†’ Undo (only one level in Bash)

Alt + B β†’ Move back one word

Alt + F β†’ Move forward one word

Alt + D β†’ Delete word after cursor

Alt + . β†’ Insert last argument of previous command

Alt + U β†’ Uppercase word from cursor

Alt + L β†’ Lowercase word from cursor

Alt + T β†’ Transpose words


πŸ–₯️ Terminator-specific shortcuts

Terminator binds some Ctrl + Shift combos instead of plain Ctrl, to avoid clashing with Bash.

Ctrl + Shift + T β†’ Open new tab

Ctrl + Shift + N β†’ Open new window

Ctrl + Shift + O β†’ Split terminal horizontally

Ctrl + Shift + E β†’ Split terminal vertically

Ctrl + Shift + W β†’ Close current terminal pane

Ctrl + Shift + Q β†’ Quit Terminator

Alt + Arrow Key β†’ Move focus between split panes

Ctrl + Shift + ↑ / ↓ / ← / β†’ β†’ Resize split panes


βš™οΈ GNOME terminal conventions

GNOME doesn’t hijack your terminal keys much, but system-level shortcuts can interfere:

  • Alt + F2 β†’ Opens GNOME run dialog (outside the terminal)

  • Alt + Tab β†’ Window switcher (global)


🧩 X11 note

On X11, Alt is handled as Meta β€” so these should Just Work unless you remap keys or the window manager grabs them. Mutter generally won’t override typical Bash Alt shortcuts inside the terminal.


⚑ One hidden gotcha

If you’re using terminator inside GNOME with gdm3 and Mutter, remember that Alt shortcuts sometimes get grabbed by the window manager. If a shortcut isn’t working, it’s usually the window manager, not Bash.


TL;DR

Ctrl = line editing and control.

Alt = word-level editing and argument reuse.

Ctrl + Shift = terminal pane/tab management in terminator.


Manamama avatar Jul 18 '25 16:07 Manamama

Seems ctrl+y is now assigned to "yolo" mode so the Yank (paste) what you just cut with Ctrl+U/K/W does not work now.

thienedits avatar Aug 09 '25 03:08 thienedits

Hello! As part of our effort to keep our backlog manageable and focus on the most active issues, we are tidying up older reports.

It looks like this issue hasn't been active for a while, so we are closing it for now. However, if you are still experiencing this bug on the latest stable build, please feel free to comment on this issue or create a new one with updated details.

Thank you for your contribution!

gemini-cli[bot] avatar Dec 03 '25 21:12 gemini-cli[bot]

what is the update on this?

nylla8444 avatar Dec 08 '25 17:12 nylla8444