Skip to content

Commit a95af7f

Browse files
committed
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).
1 parent 4ef099b commit a95af7f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

patches/ghostty-wasm-api.patch

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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)