Skip to content

Commit 86ebd9c

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 6ea6f04 commit 86ebd9c

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
@@ -769,6 +769,10 @@ index 000000000..c39b0791c
769769
+ .config = config,
770770
+ };
771771
+
772+
+ // Enable linefeed mode so \n performs carriage return (moves cursor to column 0)
773+
+ // Without this, \n only moves down without returning to column 0, causing staggered text
774+
+ wrapper.terminal.modes.set(.linefeed, true);
775+
+
772776
+ return @ptrCast(wrapper);
773777
+}
774778
+

0 commit comments

Comments
 (0)