-
Notifications
You must be signed in to change notification settings - Fork 164
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
Update crossterm to version 0.26.1 #560
Conversation
Nice. I'd be happy to close #464 if this implements the stuff it was trying to. |
No worries at all. I'm super pumped to see you work on this. Great work!
#464 was very incomplete. I'd go with your implementation but just add the things that were left out that are in 464 maybe? |
Sure, I can try it :-) Maybe the most tricky part it how to handle |
We could also do it in 2 steps.
|
I'd prefer to do it in 2 steps, to keep our changeset smaller :-) |
Blocked by sharkdp/lscolors#58 |
Thanks for tackling this big challenge @WindSoilder! That whole wezterm bug is really driving home what a mess the whole terminal "protocol" is on the edges. Props to the crossterm team for still making it work! Sorry that I don't have too much time this week to review or red-team this PR. Things I would check manually as they are not really directly tested on our side:
|
From my testing, I haven't seen any problems. I've only tested on windows with Windows Terminal and with WezTerm with |
Gave it some manual testing as well and seems to keep all expected functionality. I would like to see this landed with some priority so we can finally get rid of the duplicated old crossterm version in our dependencies. Great work @WindSoilder ! |
I think there's 2 options to landing this now.
|
I'd prefer 1st option, and created a relative issue to ask for a new version.. |
Since we don't get reply yet, I'd propose 3rd option: copy-paste lscolors' crossterm relative code in the pr: nushell/nushell@e423dca Then we can play with latest crossterm version. And we can adjust our dependency once lscolor is published. |
Option 4: (I think would also need a version change) use nu_ansi_term instead of crossterm to interface with lscolors. It is lighterweight (should finish earlier in the compile graph) and has been seeing less changes in recent months. addendum I think I tried this way back and ran into some issue but I think that should be solve (either the nuansi Deref weirdness or the fact that it was just ansiterm) |
I just noticed that lscolors has a nu-ansi-term feature. We should use that. |
@sholderbach Yeah, it's still need lscolor version change too....just create a pr to update it... Edit: we can't update nu-ansi-term to latest version in lscolors, because CI/CD check failed: https://github.com/sharkdp/lscolors/actions/runs/4676435880/jobs/8282744211, which requires rustc 1.58 version |
Hooray! lscolors released a new version with latest crossterm and nu_ansi_term version, I've adjusted nushell pr, so it's ready for now |
I vote to land this. Even if it doesn't enable all the features of crossterm 26.1, it gets us on that version where we can add those features later that were in my original PR for crossterm 25. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much! Let's go
# Description This pr is a companion to nushell/reedline#560 Fortunally, we don't need to change too much nushell code. ## Additional note about lscolor dependency sharkdp/lscolors#58 lscolor is using 0.26 for now
# Description This pr is a companion to nushell/reedline#560 Fortunally, we don't need to change too much nushell code. ## Additional note about lscolor dependency sharkdp/lscolors#58 lscolor is using 0.26 for now
Leaving this here in case we start seeing problems. Some people are having problems with crossterm + Windows. See the linked issues here. mikaelmello/inquire#132 |
WARN: do not merge this yet, it's a breaking change to nushell.
After investigate, the main changes from crossterm
0.24.0
to0.26.1
includes the following:crossterm::cursor::CursorShape
andcrossterm::cursor::SetCursorShape
, usingcrossterm::cursor::SetCursorStyle
instead.kind
andstate
fields. In the case, I don't think we need to take care ofstate
field, but need to be careful tokind
field, when we release a key, crossterm will fire a Release event.Followed by @sholderbach 's suggestion, I create a
ReedlineRawEvent
, which is a wrapper forcrossterm::event::Event
,ReedlineRawEvent
will make sure that it won't be created byRelease event
. Maybe it's better to createreedline::KeyEvent
, but I think filter the event atEvent
level rather thanKeyEvent
leval is easier, so I just leave it away for now :-)Also add an example
event_listener_kitty_proto.rs
to play with kitty protocol.Additional note about wezterm:
wezterm
have an issue aboutRelease event
, it will passPress event
to crossterm. So we have to suggest user to turn off enable_kitty_keyboard option, luckly it's disabled by default. Here is the relative issue: wezterm/wezterm#3220