mirror of
https://github.com/Rigellute/spotify-tui.git
synced 2026-04-26 08:05:57 +03:00
[PR #99] [MERGED] Using cossterm for windows support. #607
Labels
No labels
bug
enhancement
good first issue
help wanted
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotify-tui#607
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Rigellute/spotify-tui/pull/99
Author: @TimonPost
Created: 10/22/2019
Status: ✅ Merged
Merged: 12/24/2019
Merged by: @Rigellute
Base:
master← Head:crossterm_impl📝 Commits (2)
050622eImplemented crossterm for crossplatform compatibility.cb948e1Removed windows note from readme, and utils file.📊 Changes
29 files changed (+533 additions, -313 deletions)
View changed files
📝
Cargo.lock(+173 -148)📝
Cargo.toml(+2 -2)📝
README.md(+0 -6)➕
src/event/events.rs(+73 -0)➕
src/event/key.rs(+179 -0)➕
src/event/mod.rs(+7 -0)📝
src/handlers/album_list.rs(+5 -3)📝
src/handlers/album_tracks.rs(+5 -3)📝
src/handlers/artist_albums.rs(+5 -3)📝
src/handlers/artists.rs(+2 -3)📝
src/handlers/common_key_events.rs(+2 -2)📝
src/handlers/empty.rs(+7 -5)📝
src/handlers/error_screen.rs(+1 -2)📝
src/handlers/help_menu.rs(+1 -2)📝
src/handlers/home.rs(+1 -1)📝
src/handlers/input.rs(+3 -3)📝
src/handlers/library.rs(+2 -2)📝
src/handlers/made_for_you.rs(+1 -1)📝
src/handlers/mod.rs(+3 -3)📝
src/handlers/playbar.rs(+1 -1)...and 9 more files
📄 Description
Fixes: https://github.com/Rigellute/spotify-tui/issues/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 implementCopyhowever, this is going to be fixed in 0.12.2.The real blocker here was that
crossterm::KeyEventdid not implementCopyand therefore it has to be wrapped in order for it to be used.Introduced:
Keyenum, this enum is used in the library and should be used instead of thetermion::Keyorcrossterm::KeyEventor 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.CrosstermBackendthis 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?
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.