Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resetting terminal cursor shape after exiting helix seems broken in 24.03 #10089

Open
archseer opened this issue Apr 1, 2024 Discussed in #10071 · 9 comments
Open

Resetting terminal cursor shape after exiting helix seems broken in 24.03 #10089

archseer opened this issue Apr 1, 2024 Discussed in #10071 · 9 comments
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug E-has-instructions Call for participation: Has instructions for fixing the issue and opening a PR

Comments

@archseer
Copy link
Member

archseer commented Apr 1, 2024

Discussed in #10071

Originally posted by wyw March 31, 2024

Screen.Recording.2024-03-31.at.21.32.39.mov

Related issue & PR:

Resetting the terminal cursor shape after exiting helix worked before the commit 553ffbc in version a276726:

Screen.Recording.2024-03-31.at.22.24.24.mov
@archseer
Copy link
Member Author

archseer commented Apr 1, 2024

Relevant comment from @kladd #8591 (comment) that I've originally missed since it was made after the PR was already merged

@pascalkuthe
Copy link
Member

We should probably check what vim does and copy that. Terminfo is just a garden of weirdly noncompatible stuff (as is everything with terminals in general)

@lpoirothattermann
Copy link

Same behavior for me.

@kirawi
Copy link
Member

kirawi commented Apr 1, 2024

Are we planning to backport this to 24.03? It seems like it could be a significant regression.

@pascalkuthe
Copy link
Member

Oh god that is an abomination.

Probably need to implement that since we don't allow people to override escape sequences themselves

@kirawi kirawi added C-bug Category: This is a bug A-helix-term Area: Helix term improvements E-has-instructions Call for participation: Has instructions for fixing the issue and opening a PR labels Apr 3, 2024
@kirawi
Copy link
Member

kirawi commented Apr 6, 2024

I think we'd want to add it to this function:

pub fn from_env_or_default(config: &EditorConfig) -> Self {
match termini::TermInfo::from_env() {
Err(_) => Capabilities {
has_extended_underlines: config.undercurl,
..Capabilities::default()
},
Ok(t) => Capabilities {
// Smulx, VTE: https://unix.stackexchange.com/a/696253/246284
// Su (used by kitty): https://sw.kovidgoyal.net/kitty/underlines
// WezTerm supports underlines but a lot of distros don't properly install it's terminfo
has_extended_underlines: config.undercurl
|| t.extended_cap("Smulx").is_some()
|| t.extended_cap("Su").is_some()
|| vte_version() >= Some(5102)
|| matches!(term_program().as_deref(), Some("WezTerm")),
reset_cursor_command: t
.utf8_string_cap(termini::StringCapability::CursorNormal)
.unwrap_or("\x1B[0 q")
.to_string(),
},
}
}

@cjbayliss
Copy link

cjbayliss commented Apr 9, 2024

temporary workaround for fish users using alacritty, shouldn't be to hard to adapt for other shells:

# FIXME: remove once https://github.com/helix-editor/helix/issues/10089 is fixed
function hx
    command hx $argv
    printf '\033[0 q'
end

EDIT: doesn't reset the cursor if helix is run in other ways, e.g. via git commit

@kirawi
Copy link
Member

kirawi commented Apr 13, 2024

#6565 is related

cjbayliss added a commit to cjbayliss/helix that referenced this issue May 14, 2024
using a terminfo's cnorm doesn't reset the cursor for many terminals,
see issue: helix-editor#10089
cjbayliss added a commit to cjbayliss/helix that referenced this issue May 15, 2024
using a terminfo's cnorm doesn't reset the cursor for many terminals,
see issue: helix-editor#10089
cjbayliss added a commit to cjbayliss/helix that referenced this issue May 15, 2024
using a terminfo's cnorm doesn't reset the cursor for many terminals,
see issue: helix-editor#10089
cjbayliss added a commit to cjbayliss/helix that referenced this issue May 16, 2024
using a terminfo's cnorm doesn't reset the cursor for many terminals,
see issue: helix-editor#10089
cjbayliss added a commit to cjbayliss/helix that referenced this issue May 17, 2024
using a terminfo's cnorm doesn't reset the cursor for many terminals,
see issue: helix-editor#10089
cjbayliss added a commit to cjbayliss/helix that referenced this issue May 17, 2024
using a terminfo's cnorm doesn't reset the cursor for many terminals,
see issue: helix-editor#10089
cjbayliss added a commit to cjbayliss/helix that referenced this issue May 20, 2024
using a terminfo's cnorm doesn't reset the cursor for many terminals,
see issue: helix-editor#10089
cjbayliss added a commit to cjbayliss/helix that referenced this issue May 20, 2024
using a terminfo's cnorm doesn't reset the cursor for many terminals,
see issue: helix-editor#10089
cjbayliss added a commit to cjbayliss/helix that referenced this issue May 22, 2024
using a terminfo's cnorm doesn't reset the cursor for many terminals,
see issue: helix-editor#10089
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug E-has-instructions Call for participation: Has instructions for fixing the issue and opening a PR
Projects
None yet
Development

No branches or pull requests

5 participants