From c1fbe237c98bf95a03915db32a0c8316eba80ac5 Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Wed, 6 Nov 2024 18:53:12 +0100 Subject: [PATCH] Make cursor visible after commands Just like we already fix terminal modes if a command left them broken, having an invisible cursor makes the terminal hard to use and so we fix it. We can't really use cnorm/cursor_normal because that often includes other gunk like making the cursor blink, but it turns out every terminfo entry agrees on the sequence to make the cursor visible, so we hardcode it. Fixes #10834 --- src/reader.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/reader.rs b/src/reader.rs index 1f6d7abf3..b225f9779 100644 --- a/src/reader.rs +++ b/src/reader.rs @@ -667,6 +667,9 @@ fn read_i(parser: &Parser) -> i32 { // Allow any pending history items to be returned in the history array. data.history.resolve_pending(); + // Make cursor visible. Every even vaguely used terminal agrees on this sequence. + data.screen.write_bytes(b"\x1b[?12l"); + let already_warned = data.did_warn_for_bg_jobs; if check_exit_loop_maybe_warning(Some(&mut data)) { break;