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
Using cossterm for windows support. #99
Conversation
I tried this app out, however something went wrong with my authentication URL redirect. Not sure if anything went wrong with this implementation or authentication. |
Thanks for looking into this @TimonPost! This is great work, I'd love for I think your To respond to your questions above,
I'm now thinking that we should wait for/push But sounds like we're pretty close to supporting Windows, so once again thank you for this investigation! |
left an issue here: fdehau/tui-rs#192 |
bcda012
to
e130a83
Compare
I updated to the newest version of crossterm 0.14. We will have to wait for TUI to merge and release this branch. Then this PR can finally be merged. |
|
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.
Incredible work @TimonPost!
Looking forward to trying this out!
.idea/vcs.xml
Outdated
@@ -0,0 +1,6 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> |
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.
Are you able to remove the .idea
directory?
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.
Certainly.
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.
Just tested this PR on macOS and all looks good!
Perhaps we could merge your other PR merging the imports first?
We can then finally rebase this PR and it should be ready to merge to master!
Nice, merging #190 sounds like a good idea. I made that one because this one accidentally included those changes as well. By merging that one, we can reduce the number of changes, which will make it a bit easier to see what the actual changes are. I will do a rebase once that one is merged. |
ea351ca
to
57170ad
Compare
- Remove Termion dependency - Use crossterm feature flag TUI - Added event module, for event handling behaviour. - Implemented crossterm 0.14.
57170ad
to
050622e
Compare
I rebased and removed the idea files. It should be ready to be merged. |
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.
Incredible work @TimonPost!
Thank you 👍.
It is so awesome that spotify-tui will now work on Windows!
@TimonPost have run into a problem after merging - pressing
Which then crashes that terminal session. Any ideas? Will revert until this is ironed out. |
ctrl-c stops the event reading loop. When this happens, the thread will finish, and the sender's side will be disposed of. If there is no sender, then the receiving side will error. First, this wasn't the case, because the ticking thread also had a clone of the sender: https://github.com/Rigellute/spotify-tui/blob/master/src/util.rs#L55. However, crossterm can do both ticking and event reading in one thread. This sender can probably be kept as a local field in This isn't a huge deal, I can look at this tomorrow. |
Can you try this commit: TimonPost@ca32947 It did not work at my PC yet, going look into this a bit more tomorrow. However, you might give it a try. |
Fixes: #69
This app can support windows very easily. TUI has the crossterm backend which is made to support cross-platform.
I tried to move this library over to crossterm just to experiment to how easy it was to swap termion. It was very easy. Please have a look at this fork.
Although...
Their implementation uses crossterm 0.9 and 0.12 is already out and they didn't even release my latest patch - done a few months ago - with 0.10 yet. This old version of crossterm has some problems and ideally it should use 0.12 it's way better performance-wise as well.
However, I encountered problems:
-.
KeyEvent
(replacement forKey
) does not implementCopy
however, this is going to be fixed in 0.12.2.The real blocker here was that
crossterm::KeyEvent
did not implementCopy
and therefore it has to be wrapped in order for it to be used.Introduced:
Key
enum, this enum is used in the library and should be used instead of thetermion::Key
orcrossterm::KeyEvent
or others toughtout the crates. You probably don't want to depend on a certain library restricted to linux but have a small abstraction so that crossterm, for example, can be implemented with more ease.CrosstermBackend
this uses crossterm for its implementation and is crossplatform.Qustions:
This is just an experiment because I wanted to listen to Spotify on windows, however, there are some concerns with git dependencies and old versions of crossterm. Do you think crossterm should be behind a feature flag, the only supported implementation, or not used at all?