Skip to content

Text selection #5

@12Me21

Description

@12Me21

Terminal should allow selecting text with the mouse (when mouse input reporting isn't enabled) and/or keybinds, and copying it to the clipboard.

issues:

  • normal vs rectangle selections? in my experience rectangular works better, but maybe there should be some way to do both, or at least a setting
  • Text needs to be cleaned up before putting it in the clipboard
    • remove blank cells + whitespace from end of lines
    • replace blank cells with spaces
    • insert newline chars (how to detect wrapping vs real newlines? I think we need to add a flag to lines, for whether they were ended with a newline or an auto-wrap (this will also be useful for re-wrapping on resize))
    • don't forget combining chars
  • idea: support exporting as other formats (i.e. html), which can preserve text formatting (colors etc.). I believe you can specify multiple clipboard formats, so perhaps provide plaintext and html and let the destination program decide.
  • probably a good idea to freeze output during text selection (allow user scrolling though)

Different ways of handling clipboard:

  1. use X "selection" clipboard (selected text can be pasted into any program by middle clicking)
  2. Set clipboard as soon as selection is made (really, this is the same as 1 but uses clipboard instead of selection, which more users are familiar with now).
    This may be more convenient (since, usually you select text because you want to copy it) but can also result in accidentally overwriting the clipboard...
  3. set clipboard with some keybind (usually ctrl+shift+c. I think some terminals capture ctrl+c if there is a selection, which is probably the best option)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions