directvt / vtm

Text-based desktop environment
MIT License
1.63k stars 43 forks source link

One-shot toggle to copy text while mouse tracking is active #588

Closed o-sdn-o closed 7 months ago

o-sdn-o commented 7 months ago

I think a one-shot toggle on the vtm terminal side would be useful for selecting and copying text while mouse tracking is active.

xlink https://github.com/directvt/vtm/issues/584#issuecomment-2048214741

New configurable menu button: Action Description
TerminalSelectionOneShot One-shot toggle to copy text while mouse tracking is active. Keep selection if Ctrl key is pressed.
The data= attribute can have the following values none, text, ansi, rich, html, protected.

Configuration example (settings.xml)

<config>
  <term>
    <item label=" HTML " data=none type=Option action=TerminalSelectionOneShot>
      <label="\e[48:2:0:128:128;38:2:0:255:255m HTML \e[m" data=html>
        <notes>
          " One-shot toggle to copy as HTML \n"
          " while mouse tracking is active. "
        </notes>
      </label>
    </item>
    <item label=" RTF " data=none type=Option action=TerminalSelectionOneShot>
      <label="\e[48:2:128:0:0;38:2:255:255:0m RTF \e[m" data=rich>
        <notes>
          " One-shot toggle to copy as RTF  \n"
          " while mouse tracking is active. "
        </notes>
      </label>
    </item>
    <item label="OneShot" data=none type=Option action=TerminalSelectionOneShot>
      <label="\e[48:2:128:0:0;38:2:255:255:0m  RTF  \e[m" data=rich>
        <notes>
          " One-shot toggle to copy as RTF  \n"
          " while mouse tracking is active. "
        </notes>
      </label>
      <label=" \e[48:2:0:128:128;38:2:0:255:255m HTML \e[m" data=html>
        <notes>
          " One-shot toggle to copy as HTML \n"
          " while mouse tracking is active. "
        </notes>
      </label>
    </item>
  </term>
</config>

!image