Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/pty/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ mod tests {

#[test]
fn send_data_buffers_when_socket_would_block() -> Result<()> {
let (mut writer, mut reader) = UnixStream::pair()?;
let (writer, mut reader) = UnixStream::pair()?;
writer.set_nonblocking(true)?;

let mut client = ClientInfo::new(writer);
Expand Down
13 changes: 10 additions & 3 deletions src/pty/terminal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,17 @@ pub fn send_refresh(stream: &mut impl Write) -> io::Result<()> {

/// Send terminal refresh sequences to restore normal state
pub fn send_terminal_refresh_sequences(stream: &mut impl Write) -> io::Result<()> {
// Send minimal refresh sequences without modifying cursor
// Send refresh sequences to restore standard terminal state after TUIs
let refresh_sequences = [
"\x1b[m", // Reset all attributes
"\x0c", // Form feed (clear screen)
"\x1b[m", // Reset all attributes
"\x1b[?25h", // Ensure cursor is visible
"\x1b[?7h", // Enable auto-wrap
"\x1b[?1000l", // Disable mouse tracking
"\x1b[?1002l", // Disable cell motion mouse tracking
"\x1b[?1003l", // Disable all motion mouse tracking
"\x1b[?2004l", // Disable bracketed paste
"\x1b[0;0r", // Reset scroll region
"\x0c", // Clear screen
]
.join("");

Expand Down