mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
fix tab behavior, should not print
This commit is contained in:
@ -19,3 +19,4 @@ Status meanings:
|
|||||||
| `ENQ` | `0x05` | [Enquiry](sequences/enq.md) | ✅ |
|
| `ENQ` | `0x05` | [Enquiry](sequences/enq.md) | ✅ |
|
||||||
| `BEL` | `0x07` | [Bell](sequences/bel.md) | ❌ |
|
| `BEL` | `0x07` | [Bell](sequences/bel.md) | ❌ |
|
||||||
| `BS` | `0x08` | [Backspace](sequences/bs.md) | ⚠️ |
|
| `BS` | `0x08` | [Backspace](sequences/bs.md) | ⚠️ |
|
||||||
|
| `TAB` | `0x09` | [Tab](sequences/tab.md) | ⚠️ |
|
||||||
|
21
docs/sequences/tab.md
Normal file
21
docs/sequences/tab.md
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# Tab
|
||||||
|
|
||||||
|
| | |
|
||||||
|
| --- | --- |
|
||||||
|
| Text | |
|
||||||
|
| Hex | `0x09` |
|
||||||
|
|
||||||
|
Move the cursor right to the next tab stop.
|
||||||
|
|
||||||
|
A tab stop is a specifically marked column that a cursor stops when a tab
|
||||||
|
is invoked. Tab stops are typically thought of as uniform spacing (i.e.
|
||||||
|
four spaces) but in terminals this is not the case: tab stops can be set
|
||||||
|
at any column number using the [tab set](#) and [tab clear](#)
|
||||||
|
sequences.
|
||||||
|
|
||||||
|
Initially, tab stops are set on every 8th column.
|
||||||
|
|
||||||
|
## TODO
|
||||||
|
|
||||||
|
* Integration with left/right margins of the scrolling region.
|
||||||
|
* How does horizontal tab interact with the pending wrap state?
|
@ -543,8 +543,8 @@ pub fn horizontalTab(self: *Terminal) !void {
|
|||||||
defer tracy.end();
|
defer tracy.end();
|
||||||
|
|
||||||
while (self.cursor.x < self.cols) {
|
while (self.cursor.x < self.cols) {
|
||||||
// Clear
|
// Move the cursor right
|
||||||
try self.print(' ');
|
self.cursor.x += 1;
|
||||||
|
|
||||||
// If the last cursor position was a tabstop we return. We do
|
// If the last cursor position was a tabstop we return. We do
|
||||||
// "last cursor position" because we want a space to be written
|
// "last cursor position" because we want a space to be written
|
||||||
|
Reference in New Issue
Block a user