replace termion with crossterm and make colors configurable#156
replace termion with crossterm and make colors configurable#156cantino merged 3 commits intocantino:masterfrom
Conversation
|
Thanks @dmfay for working on this! Since some users use Also, please note that my wife and I just had our first child this week and so I will be slow to reply for a while... |
|
Congratulations to both of you! Detecting |
|
Nice! |
04e1d59 to
788b1dd
Compare
|
Here's the rebase, for whenever's convenient! This version also prints a full-width cursor, but enough else changed over time in interface.rs that squashing was the better part of valor. |
|
Hey @dmfay, are you up for another rebase? I think the only change is moving ctrl-d to delete a character instead of exit from the interface. I'm getting this error when I try to build this PR: Do we have to use experimental features now? |
788b1dd to
960844b
Compare
|
Updated! As for experimental features, you might need to update Rust? I'm not seeing that issue with 1.53 (and track_caller has made it to stable). |
|
I updated rust and it builds successfully! However, now I'm getting: When I try to launch mcfly. |
|
I can replicate that with osx + zsh + ctrl-r -- in linux it's fine, in bash it's fine, running thread 'main' panicked at 'McFly error: failed to read input IoError(Custom { kind: Other, error: "Failed to initialize input reader" })', src/interface.rs:340:43crossterm-rs/crossterm#500 may be relevant -- here's another crossterm-using project with an osx-only problem. I disabled the terminfo changes and tty pipe in mcfly-history-widget and that didn't avert a panic, though. |
|
Hey, I just want to say I'd love to have configurable colors, this looks broken in Unikitty Light as well. 👍 I tried your branch @dmfay and I get the same results. |
load and apply config from ~/.mcfly/mcfly.toml sample config file remove lightmode in favor of color customization interface cleanup and formatting correct example key_scheme supply alternate default colors for MCFLY_LIGHT
960844b to
6b89f60
Compare
|
👋🏼 Another Crossterm user here, that just happened to have one of my projects linked in a comment. Crossterm just pushed a fix for crossterm-rs/crossterm#500, so it's possible that the problem blocking this PR has been addressed. I haven't tried the fix in my project yet, but figured a ping here wouldn't hurt. |
This started because I wanted to customize colors, and turned into something of a rabbit hole. To summarize:
Outside the terminal code, mcfly now reads colors and other settings from ~/.mcfly/mcfly.toml, defaulting to the original styling and config if the file doesn't exist. Environment variables are still supported and there's a self-describing sample config file. I don't have a Windows machine to test compatibility, so there are likely as not more obstacles, but it's a big step closer.
I did removeMCFLY_LIGHTentirely, so this conflicts with #151 (sorry!). If we want multiple colorschemes, figment's switchable profiles may be useful.It also conflicts with #149, but that I can rebase.