You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/apps.md
+36-4Lines changed: 36 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,12 +41,43 @@
41
41
- Floating point (pixel-wise) mouse reporting.
42
42
- Stdin/stdout logging.
43
43
44
+
### Terminal control using Lua scripts via APC
45
+
46
+
The built-in terminal is capable of executing Lua scripts received via APC (Application Program Command) vt-sequences. The format of the vt-sequence is as follows:
47
+
48
+
```
49
+
ESC _ <script body> ESC \
50
+
```
51
+
or
52
+
```
53
+
ESC _ <script body> BEL
54
+
```
55
+
where:
56
+
-`ESC_` is the APC vt-sequence prefix.
57
+
-`<script body>` - Lua script sent for execution.
58
+
-`ESC\` or `BEL` - APC vt-sequence terminator.
59
+
60
+
Usage examples:
61
+
-`bash`:
62
+
```
63
+
# Print the current scrollback buffer limits
64
+
printf "\e_local n,m,q=vtm.terminal.ScrollbackSize(); vtm.terminal.PrintLn('size=', n, ' growstep=', m, ' maxsize=', q)\e\\"
`CCC_SBS` | `CSI` 24 : n : m : q `p` | Set scrollback buffer limits:<br>`n` Initial buffer size<br>`m` Grow step<br>`q` Grow limit
49
-
`CCC_SGR` | `CSI` 28 : Pm `p` | Set terminal background using SGR attributes (one attribute per call):<br>`Pm` Colon-separated list of attributes, 0 — reset all attributes, _default is 0_
79
+
`CCC_SBS` | `CSI` 24 : n : m : q `p` | Set scrollback buffer parameters:<br>`n` Initial buffer size<br>`m` Grow step<br>`q` Grow limit
80
+
`CCC_SGR` | `CSI` 28 : Pm `p` | Set terminal background SGR attribute:<br>`m` SGR attribute (attribute m may include subarguments separated by colons), 0 — reset all attributes, _default is 0_
50
81
`CCC_SEL` | `CSI` 29 : n `p` | Set text selection mode:<br>`n = 0` Selection is off<br>`n = 1` Select and copy as plaintext (default)<br>`n = 2` Select and copy as ANSI/VT text<br>`n = 3` Select and copy as RTF-document<br>`n = 4` Select and copy as HTML-code<br>`n = 5` Select and copy as protected plaintext (suppressed preview, [details](https://learn.microsoft.com/en-us/windows/win32/dataxchg/clipboard-formats#cloud-clipboard-and-clipboard-history-formats))
51
82
`CCC_PAD` | `CSI` 30 : n `p` | Set scrollback buffer left and right side padding:<br>`n` Width in cells, _max = 255, default is 0_
52
83
`CCC_RST` | `CSI` 1 `p` | Reset all parameters to default
@@ -144,7 +175,8 @@ Screenshot:
144
175
145
176
### Floating point (pixel-wise) mouse reporting
146
177
147
-
On Windows, when using the Win32 Console API, vtm reports mouse events with fractional mouse coordinates. Fractional coordinates are 32-bit floating-point numbers that represent the position of the cursor relative to the console's grid of text cells. Screen pixel coordinates can be calculated by multiplying the fractional coordinates by the cell size.
178
+
On Windows, when using the Win32 Console API, vtm reports mouse events with fractional mouse coordinates. Pixel-wise or fractional coordinates are 32-bit floating-point numbers that represent the position of the mouse cursor relative to the console's grid of text cells. Screen pixel coordinates can be calculated by multiplying the fractional coordinates by the cell size.
179
+
Fractional mouse coordinates are critical to UX. In particular, this directly relates to the sensitivity of scrollbars, where moving the mouse pointer even one pixel can cause content to scroll several lines.
Copy file name to clipboardExpand all lines: doc/settings.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -620,7 +620,8 @@ Standard object names
620
620
| | | `vtm.terminal.ScrollViewportToTop()` | Scroll the terminal viewport to the scrollback top.
621
621
| | | `vtm.terminal.ScrollViewportToEnd()` | Scroll the terminal viewport to the scrollback bottom.
622
622
| | | `vtm.terminal.SendKey(string s)` | Send the text string `s` as terminal input.
623
-
| | | `vtm.terminal.Print(string s)` | Print the text string `s` to the terminal scrollback buffer.
623
+
| | | `vtm.terminal.Print(auto args, ...)` | Print the specified args to the terminal scrollback buffer.
624
+
| | | `vtm.terminal.PrintLn(auto args, ...)` | Print the specified args and move the text cursor to the next line.
624
625
| | | `vtm.terminal.CopyViewport()` | Сopy terminal viewport to the clipboard.
625
626
| | | `vtm.terminal.CopySelection()` | Copy selected lines or the current line to the clipboard.
626
627
| | | `vtm.terminal.PasteClipboard()` | Paste from clipboard.
@@ -642,6 +643,8 @@ Standard object names
642
643
| | | `vtm.terminal.LogMode(int n)` | Set the current terminal logging mode on/off.
643
644
| | | `vtm.terminal.LogMode() -> int` | Get the current terminal logging mode state.
644
645
| | | `vtm.terminal.ClearScrollback()` | Clear the terminal scrollback buffer.
646
+
| | | `vtm.terminal.ScrollbackSize() -> int n, m, q` | Get the current scrollback buffer parameters (three integer values):<br>`n` Initial buffer size<br>`m` Grow step<br>`q` Grow limit
647
+
| | | `vtm.terminal.ScrollbackSize(int n, int m, int q)` | Set scrollback buffer parameters:<br>`n` Initial buffer size<br>`m` Grow step<br>`q` Grow limit
645
648
| | | `vtm.terminal.Restart()` | Restart the current terminal session.
0 commit comments