Skip to content

Commit 65ec22a

Browse files
committed
fix(mobile): avoid iOS terminal reset on clear
1 parent de592a0 commit 65ec22a

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎apps/mobile/modules/t3-terminal/ios/T3TerminalView.swift‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,12 @@ public final class T3TerminalView: ExpoView, UITextFieldDelegate {
535535
return
536536
}
537537

538+
if buffer.isEmpty {
539+
feedData(Data("\u{1B}[3J\u{1B}[H\u{1B}[2J".utf8))
540+
lastAppliedBuffer = ""
541+
return
542+
}
543+
538544
if buffer.hasPrefix(lastAppliedBuffer) {
539545
let suffix = String(buffer.dropFirst(lastAppliedBuffer.count))
540546
feedData(Data(suffix.utf8))

0 commit comments

Comments
 (0)