d99kris / nchat

Terminal-based Telegram / WhatsApp client for Linux and macOS
MIT License
619 stars 43 forks source link

[Enhancement] Add copy/paste support #61

Closed Bellavene closed 1 year ago

Bellavene commented 2 years ago

Would be great to have native copy/paste support with pbcopy and pbpaste or similar on GNU systems. Also I see a need to use standard shortcuts like ctrl+A or alt+A to select all typed text, so you can delete all at once. And of course standard terminal behavior jumping text around, like alt+left or alt+shift+left, one word backwards and select one word backwards.

d99kris commented 2 years ago

I'm a little hesitant towards in-app copy/paste/selection for nchat, as it makes code/ui more complex, and the terminal (generally) already provides such functionality.

Note that one can use ctrl-u / ctrl-k to delete input buffer - similar to bash. Adding support for other common terminal text navigation (jumping) shortcuts would probably make sense though. Will try take a look at that.

d99kris commented 1 year ago

Adding support for other common terminal text navigation (jumping) shortcuts would probably make sense though. Will try take a look at that.

With commit 0239998 improved support for text navigation/editing was implemented. nchat should now support: Left, Right, Backspace, Delete, ^A, ^E, ^K, ^U, Alt-Left, Alt-Right, Alt-Backspace, Alt-Delete.

d99kris commented 1 year ago

Regarding copy/paste I'll leave this issue open for now, until I've checked if some basic support can be added without too much complexity.

d99kris commented 1 year ago

Clipboard (cut/copy/paste of text) support has been added in above commit. Default keybindings are alt-x, alt-c, alt-v. Please open a new issue if any bug is found.