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

Select with shift-cursor and cut, copy and paste #380

Closed
DejayRezme opened this issue Apr 5, 2022 · 7 comments
Closed

Select with shift-cursor and cut, copy and paste #380

DejayRezme opened this issue Apr 5, 2022 · 7 comments
Labels
A-EditOps Area: core editing operations (shared between keybindings) enhancement New feature or request

Comments

@DejayRezme
Copy link

DejayRezme commented Apr 5, 2022

I'm really missing features to select text with keys to mark for cut, copy and pasting. Not sure if this is the right place to suggest this or if this is planned or if there is some other way of doing this with bash or emacs knowledge.

  • shift-cursor left or right to select (mark) chars
  • control-shift-cursor left or right to select words
  • control-x should cut selected text
  • delete should delete selected text
  • control-a should selects whole line (or use CutCurrentLine? instead)
  • All CutXXX commands like "CutFromStart" or "CutWordLeft" should use the OS copy/paste buffer not an internal buffer

Maybe there could also be a mode where I can move around in the terminal with the cursor and mark and copy text?

The new powershell terminal does all this really nice now. Coming from windows I'm really missing these features since they work in all text editors and I have muscle memory for them. I

References

#10

@DejayRezme DejayRezme added the enhancement New feature or request label Apr 5, 2022
@sholderbach
Copy link
Member

A selection mode inside the line is definetely in scope. And having a set of keybindings, which you are implying with ctrl-a etc., that are closer to the experience using Windows/windowed applications instead of emacs would also be nice to make it more attractive to people that previously were maybe not unix/terminal power users.

Doing selection beyond the current input buffer (e.g. previous output) is not possible with the current design as reedline is not managing the output of other programs (Basically still writes to the virtual teletype paper)

Could you move the other issues to their own? (keybindings default is implemented in part in nushell/nushell maybe file it there)

@sholderbach sholderbach added the A-EditOps Area: core editing operations (shared between keybindings) label Jan 27, 2023
@egirlcatnip
Copy link

Any updates on this? Boop

@sachinjoseph
Copy link

sachinjoseph commented Aug 14, 2023

@sholderbach @jntrnr this would be a great addition to the ux! :-)

@fdncred
Copy link
Collaborator

fdncred commented Dec 27, 2023

Adding LineEditor that implements this selection functionality and is inspired by reedline. They have found a way to do this with crossterm and we could use their code for inspiration ourselves.

@Tastaturtaste
Copy link
Contributor

I started to implement the requested functionality in #689. For now only selecting with Shift + Arrow, cut with Ctrl + X, and paste with Ctrl + V is implemented. Pasting with Ctrl + V is only possible (on windows) if reedline is compiled with the feature system_clipboard, otherwise the key combination is intercepted by windows itself and the contents of the system clipboard are pasted instead of the local contents. In nushell this feature is not enabled afaik, which I hope can be reconsidered to more seamlessly integrate with everything else.

@Tastaturtaste
Copy link
Contributor

I think this Issue can be closed, too. What do you think, @fdncred?

@fdncred
Copy link
Collaborator

fdncred commented Jan 25, 2024

indeed. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-EditOps Area: core editing operations (shared between keybindings) enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants