Closed dmfay closed 8 months ago
Thanks @dmfay for working on this! Since some users use MCFLY_LIGHT
, how easy do you think it would be to add it for backwards compatability?
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 MCFLY_LIGHT
and supplying alternate default colors turned out to be trivial, and would clear the way for #151 too -- updated.
Nice!
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:
error[E0658]: the `#[track_caller]` attribute is an experimental feature
--> /Users/andrew/.cargo/registry/src/github.com-1ecc6299db9ec823/figment-0.10.5/src/providers/serialized.rs:75:5
|
75 | #[track_caller]
| ^^^^^^^^^^^^^^^
|
= note: see issue #47809 <https://github.com/rust-lang/rust/issues/47809> for more information
error[E0658]: the `#[track_caller]` attribute is an experimental feature
--> /Users/andrew/.cargo/registry/src/github.com-1ecc6299db9ec823/figment-0.10.5/src/providers/serialized.rs:91:5
|
91 | #[track_caller]
| ^^^^^^^^^^^^^^^
|
= note: see issue #47809 <https://github.com/rust-lang/rust/issues/47809> for more information
Do we have to use experimental features now?
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:
thread 'main' panicked at 'McFly error: failed to read input IoError(Custom { kind: Other, error: "Failed to initialize input reader" })', src/interface.rs:340:43
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 mcfly search
works. Nothing jumps out at me in the zsh scripting though, and the full backtrace I cleaned up doesn't offer any obvious leads either.
https://github.com/crossterm-rs/crossterm/issues/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.
👋🏼 Another Crossterm user here, that just happened to have one of my projects linked in a comment. Crossterm just pushed a fix for https://github.com/crossterm-rs/crossterm/issues/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 remove
MCFLY_LIGHT
entirely, 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.