Skip to content

Commit

Permalink
directvt#393 WIP: Lua script as a hotkey action (xml draft)
Browse files Browse the repository at this point in the history
  • Loading branch information
o-sdn-o committed Oct 26, 2024
1 parent 29cc911 commit 7c35150
Showing 1 changed file with 33 additions and 31 deletions.
64 changes: 33 additions & 31 deletions src/vtm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -378,37 +378,39 @@ R"==(
restart: Restart session.
retry: Restart session if exit code != 0. -->
<hotkeys key*> <!-- not implemented -->
<key="" action="TerminalCwdSync(!TerminalCwdSync())"/> <!-- Current working directory sync toggle. The command to send for synchronization is configurable via the `<config><term cwdsync=" cd $P\n"/></config>` setting's option. Where `$P` is a variable containing current path received via OSC 9;9 notification. To enable OSC9;9 shell notifications: - Windows Command Prompt: `setx PROMPT $e]9;9;$P$e\$P$G` - PowerShell: `function prompt{ $e=[char]27; "$e]9;9;$(Convert-Path $pwd)$e\PS $pwd$('>' * ($nestedPromptLevel + 1)) " }` - Bash: `export PS1='\[\033]9;9;\w\033\\\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '` -->
<key="" action="TerminalWrapMode(!TerminalWrapMode())"/> <!-- Toggle terminal scrollback lines wrapping mode. Applied to the active selection if it is. The argument is boolean. -->
<key="" action="TerminalAlignMode((TerminalAlignMode() + 1) % 3)"/> <!-- Toggle terminal scrollback lines aligning mode. Applied to the active selection if it is. The argument can be the one of the following: 0:`left`, 1:`right`, 2:`center`. -->
<key="Alt+RightArrow" action="TerminalFindNext()"/> <!-- Highlight next match of selected text fragment. Clipboard content is used if no active selection. -->
<key="Alt+LeftArrow" action="TerminalFindPrev()"/> <!-- Highlight previous match of selected text fragment. Clipboard content is used if no active selection. -->
<key="" action="TerminalOutput('Hello \"world\"!')"/> <!-- Direct output the specified string to the terminal scrollback. -->
<key="" action="TerminalSendKey('A')"/> <!-- Simulating keypresses using the specified string. -->
<key="" action="TerminalQuit()"/> <!-- Terminate runnning console apps and close terminal. -->
<key="" action="TerminalRestart()"/> <!-- Terminate runnning console apps and restart current session. -->
<key="" action="TerminalFullscreen(!TerminalFullscreen())"/> <!-- Toggle fullscreen mode. -->
<key="" action="TerminalUndo()"/> <!-- (Win32 Cooked/ENABLE_LINE_INPUT mode only) Discard the last input. -->
<key="" action="TerminalRedo()"/> <!-- (Win32 Cooked/ENABLE_LINE_INPUT mode only) Discard the last Undo command. -->
<key="" action="TerminalClipboardPaste()"/> <!-- Paste from clipboard. -->
<key="" action="TerminalClipboardWipe()"/> <!-- Reset clipboard. -->
<key="" action="TerminalSelectionMode(!TerminalSelectionMode())"/> <!-- Set terminal text selection mode. The argument can be the one of the following values 0:'none', 1:'text', 2:'ansi', 3:'rich', 4:'html', 5:'protected'. -->
<key="" action="TerminalSelectionCopy()"/> <!-- Сopy selection to clipboard. -->
<key="" action="TerminalSelectionRect(!TerminalSelectionRect())"/> <!-- Toggle between linear(0) and rectangular(1) selection form. -->
<key="Esc" action="TerminalSelectionClear(); Continue()"/> <!-- Deselect a selection. -->
<key="" action="TerminalSelectionOneShot(1)"/> <!-- One-shot toggle to copy text while mouse tracking is active. Keep selection if 'Ctrl' key is pressed. The argument can be the one of the following values 0:'none', 1:'text', 2:'ansi', 3:'rich', 4:'html', 5:'protected'. -->
<key="" action="TerminalViewportCopy()"/> <!-- Сopy viewport to clipboard. -->
<key="Shift+Ctrl+PageUp" action="TerminalViewportMoveByPage(0,-1)"/> <!-- Scroll one page up. -->
<key="Shift+Ctrl+PageDown" action="TerminalViewportMoveByPage(0, 1)"/> <!-- Scroll one page down. -->
<key="Shift+Ctrl+ArrowUp" action="TerminalViewportMoveByChar(0,-1)"/> <!-- Scroll one line up. -->
<key="Shift+Ctrl+ArrowDown" action="TerminalViewportMoveByChar(0, 1)"/> <!-- Scroll one line down. -->
<key="Shift+Alt+ArrowLeft" action="TerminalViewportMoveByPage(-1, 0)"/> <!-- Scroll one page to the left. -->
<key="Shift+Alt+ArrowRight" action="TerminalViewportMoveByPage( 1, 0)"/> <!-- Scroll one page to the right. -->
<key="Shift+Ctrl+ArrowLeft" action="TerminalViewportMoveByChar(-1, 0)"/> <!-- Scroll one cell to the left. -->
<key="Shift+Ctrl+ArrowRight" action="TerminalViewportMoveByChar( 1, 0)"/> <!-- Scroll one cell to the right. -->
<key="Shift+Ctrl+Home" action="TerminalViewportMoveToTop()"/> <!-- Scroll to the scrollback top. -->
<key="Shift+Ctrl+End" action="TerminalViewportMoveToEnd()"/> <!-- Scroll to the scrollback bottom (reset viewport position). -->
<key="" action="TerminalStdioLog(!TerminalStdioLog())"/> <!-- Stdin/stdout log toggle. -->
<key="Ctrl+PageUp" action="TerminalIgnoreKey()"/> <!-- Ignore and pass keystrokes to the window manager. -->
<key="Ctrl+PageDown" action="TerminalIgnoreKey()"/> <!-- Ignore and pass keystrokes to the window manager. -->
<key="" action="TerminalCwdSync(not TerminalCwdSync())"/> <!-- Current working directory sync toggle. The command to send for synchronization is configurable via the `<config><term cwdsync=" cd $P\n"/></config>` setting's option. Where `$P` is a variable containing current path received via OSC 9;9 notification. To enable OSC9;9 shell notifications: - Windows Command Prompt: `setx PROMPT $e]9;9;$P$e\$P$G` - PowerShell: `function prompt{ $e=[char]27; "$e]9;9;$(Convert-Path $pwd)$e\PS $pwd$('>' * ($nestedPromptLevel + 1)) " }` - Bash: `export PS1='\[\033]9;9;\w\033\\\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '` -->
<key="" action="TerminalWrapMode(not TerminalWrapMode())"/> <!-- Toggle terminal scrollback lines wrapping mode. Applied to the active selection if it is. The argument is boolean. -->
<key="" action="TerminalAlignMode((TerminalAlignMode() + 1) % 3)"/> <!-- Toggle terminal scrollback lines aligning mode. Applied to the active selection if it is. The argument can be the one of the following: 0:`left`, 1:`right`, 2:`center`. -->
<key="Alt+RightArrow" action="TerminalFindNext()"/> <!-- Highlight next match of selected text fragment. Clipboard content is used if no active selection. -->
<key="Alt+LeftArrow" action="TerminalFindPrev()"/> <!-- Highlight previous match of selected text fragment. Clipboard content is used if no active selection. -->
<key="" action="TerminalOutput('Hello \"world\"!')"/> <!-- Direct output the specified string to the terminal scrollback. -->
<key="" action="TerminalSendKey('A')"/> <!-- Simulating keypresses using the specified string. -->
<key="" action="TerminalQuit()"/> <!-- Terminate runnning console apps and close terminal. -->
<key="" action="TerminalRestart()"/> <!-- Terminate runnning console apps and restart current session. -->
<key="" action="TerminalFullscreen(not TerminalFullscreen())"/> <!-- Toggle fullscreen mode. -->
<key="" action="TerminalUndo()"/> <!-- (Win32 Cooked/ENABLE_LINE_INPUT mode only) Discard the last input. -->
<key="" action="TerminalRedo()"/> <!-- (Win32 Cooked/ENABLE_LINE_INPUT mode only) Discard the last Undo command. -->
<key="" action="TerminalClipboardPaste()"/> <!-- Paste from clipboard. -->
<key="" action="TerminalClipboardWipe()"/> <!-- Reset clipboard. -->
<key="" action="TerminalSelectionMode(not TerminalSelectionMode())"/> <!-- Set terminal text selection mode. The argument can be the one of the following values 0:'none', 1:'text', 2:'ansi', 3:'rich', 4:'html', 5:'protected'. -->
<key="" action="TerminalSelectionCopy()"/> <!-- Сopy selection to clipboard. -->
<key="" action="TerminalSelectionRect(not TerminalSelectionRect())"/> <!-- Toggle between linear(0) and rectangular(1) selection form. -->
<key="Esc" action="if TerminalSelectionActive() then TerminalSelectionClear() end"/> <!-- Deselect a selection. -->
<key="" action="TerminalSelectionOneShot(1)"/> <!-- One-shot toggle to copy text while mouse tracking is active. Keep selection if 'Ctrl' key is pressed. The argument can be the one of the following values 0:'none', 1:'text', 2:'ansi', 3:'rich', 4:'html', 5:'protected'. -->
<key="" action="TerminalViewportCopy()"/> <!-- Сopy viewport to clipboard. -->
<key="Shift+Ctrl+PageUp" action="if TerminalModeNormal() then TerminalViewportMoveByPage(0,-1) end"/> <!-- Scroll one page up. -->
<key="Shift+Ctrl+PageDown" action="if TerminalModeNormal() then TerminalViewportMoveByPage(0, 1) end"/> <!-- Scroll one page down. -->
<key="Shift+Ctrl+ArrowUp" action="if TerminalModeNormal() then TerminalViewportMoveByChar(0,-1) end"/> <!-- Scroll one line up. -->
<key="Shift+Ctrl+ArrowDown" action="if TerminalModeNormal() then TerminalViewportMoveByChar(0, 1) end"/> <!-- Scroll one line down. -->
<key="Shift+Alt+ArrowLeft" action="if TerminalModeNormal() then TerminalViewportMoveByPage(-1, 0) end"/> <!-- Scroll one page to the left. -->
<key="Shift+Alt+ArrowRight" action="if TerminalModeNormal() then TerminalViewportMoveByPage( 1, 0) end"/> <!-- Scroll one page to the right. -->
<key="Shift+Ctrl+ArrowLeft" action="if TerminalModeNormal() then TerminalViewportMoveByChar(-1, 0) end"/> <!-- Scroll one cell to the left. -->
<key="Shift+Ctrl+ArrowRight" action="if TerminalModeNormal() then TerminalViewportMoveByChar( 1, 0) end"/> <!-- Scroll one cell to the right. -->
<key="Shift+Ctrl+Home" action="if TerminalModeNormal() then TerminalViewportMoveToTop() end"/> <!-- Scroll to the scrollback top. -->
<key="Shift+Ctrl+End" action="if TerminalModeNormal() then TerminalViewportMoveToEnd() end"/> <!-- Scroll to the scrollback bottom (reset viewport position). -->
<key="" action="TerminalStdioLog(not TerminalStdioLog())"/> <!-- Stdin/stdout log toggle. -->
<key="" action="TerminalLogStart()"/> <!-- not implemented. Start logging to file. -->
<key="" action="TerminalLogPause()"/> <!-- not implemented. Pause logging. -->
<key="" action="TerminalLogStop()"/> <!-- not implemented. Stop logging. -->
Expand Down

0 comments on commit 7c35150

Please sign in to comment.