directvt / vtm

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

Implement one-shot toggle to copy text #589

Closed o-sdn-o closed 7 months ago

o-sdn-o commented 7 months ago

Changes

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.

Closes #588

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=" Text " data=none type=Option action=TerminalSelectionOneShot>
      <label="\e[48:2:0:128:0;38:2:0:255:0m Text \e[m" data=text>
        <notes>
          " One-shot toggle to copy as Text \n"
          " while mouse tracking is active. "
        </notes>
      </label>
    </item>
    <item label="One-Shot" data=none type=Option action=TerminalSelectionOneShot>
      <label="\e[48:2:0:128:0;38:2:0:255:0m  Text  \e[m" data=text>
        <notes>
          " One-shot toggle to copy as Text \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>