Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 62ccefc

Browse filesBrowse files
Enable linefeed mode so newline moves cursor to column 0 (#70)
* Enable linefeed mode so newline moves cursor to column 0 Without linefeed mode enabled, \n only moves the cursor down without returning to column 0. This causes text to display in a staggered pattern instead of properly aligned at the left margin. This fix sets the linefeed terminal mode to true when creating a new terminal instance, making \n behave as expected (LF + CR). * fix: update patch header line count from 638 to 642 --------- Co-authored-by: blink-so[bot] <211532188+blink-so[bot]@users.noreply.github.com>
1 parent fcdee7f commit 62ccefc
Copy full SHA for 62ccefc

File tree

Expand file treeCollapse file tree

1 file changed

+5
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-1
lines changed
Open diff view settings
Collapse file

‎patches/ghostty-wasm-api.patch‎

Copy file name to clipboardExpand all lines: patches/ghostty-wasm-api.patch
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ new file mode 100644
622622
index 000000000..e79702488
623623
--- /dev/null
624624
+++ b/src/terminal/c/terminal.zig
625-
@@ -0,0 +1,638 @@
625+
@@ -0,0 +1,642 @@
626626
+//! C API wrapper for Terminal
627627
+//!
628628
+//! This provides a C-compatible interface to Ghostty's Terminal for WASM export.
@@ -817,6 +817,10 @@ index 000000000..e79702488
817817
+ // Initialize the persistent VT stream (must be done after terminal is set)
818818
+ wrapper.stream = wrapper.terminal.vtStream();
819819
+
820+
+ // Enable linefeed mode so \n performs carriage return (moves cursor to column 0)
821+
+ // Without this, \n only moves down without returning to column 0, causing staggered text
822+
+ wrapper.terminal.modes.set(.linefeed, true);
823+
+
820824
+ return @ptrCast(wrapper);
821825
+}
822826
+

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.