Open ErichDonGubler opened 6 years ago
Any progress on this?
@forbjok: Yes indeed! I've updated the comments with a checklist of what I see needs to happen before this is ready for PR.
I tried building your windows branch yesterday with "cargo test", but it's failing with a bunch of "Could not find attr
in sys
" errors in lib.rs, since there currently isn't an attr module in the windows version of sys. Do you have a newer one that compiles?
@forbjok: Just pushed some fixes with commit https://github.com/ErichDonGubler/termion/commit/65cc96cb3ac3dd826166546fb0e781e6737dd0e9 -- I rebased onto latest upstream changed, so you'll need to force the update.
Some tests are broken or missing, as noted in the edited OP -- but everything SHOULD compile and run just fine now. Let me know if you find anything strange.
Hi @ErichDonGubler I'll be ready to start working with you on this early next week. I got pulled onto a huge project after new years at work (which I was expecting), so it has taken me some time to get back to this. I have already pulled down your branch and started doing research. Lets start a discussion.
@mattmccarty: Sure! What's your preferred medium for collaboration? :)
Telepathy, but not everyone has that ability yet :(
It doesn't matter. I suppose we can use gitter or IRC, so if others want to jump in on the convo they can do so easily. I'll let you set it up. Just let me know.
Still with me?
@mattmccarty: Sorry, life got busy -- here is a Riot room to join. :)
What Windows versions are termion going to support? As far as I know, ANSI is Window 10 only feature. No termion Windows 7?
@VladimirMarkelov: As an initial PR, we'll want to make the leap from no Windows support as small as possible, so at least the initial work will only support Windows 10. @ticki will have to comment on whether or not he is willing to support implementation(s) of non-ANSI terminals.
Good news -- commit bf1bf13 knocked out the panicking issues with keyboard/mouse input being too fast from my testing on Windows 10! Now @mattmccarty and I just need to fix the other issues, which I'm far less worried about. :)
EDIT: Also fixed the is_tty
example. Woot!
Everyone, I've updated the information in this issue to track the status of the other issues that @mattmccarty took the initiative to create. Hopefully this gives much better visibility into the status of Windows support! :)
Any progress on this?
@fasihrana: Life has been busy for me, @mattmccarty has disappeared, so none of the issues we've created have moved forward much. I've kept the windows
and associated branches up-to-date with upstream, though!
I just cloned and did a compile of your repo on Windows 7 with git bash and I'm getting the same errors.
error[E0433]: failed to resolve. Maybe a missing `extern crate sys;`?
--> src\lib.rs:22:9
|
22 | pub use sys::size::terminal_size;
| ^^^ Maybe a missing `extern crate sys;`?
error[E0433]: failed to resolve. Maybe a missing `extern crate sys;`?
--> src\lib.rs:23:9
|
23 | pub use sys::tty::{is_tty, get_tty};
| ^^^ Maybe a missing `extern crate sys;`?
error[E0433]: failed to resolve. Maybe a missing `extern crate sys;`?
--> src\async.rs:5:5
|
5 | use sys::tty::get_tty;
| ^^^ Maybe a missing `extern crate sys;`?
error[E0432]: unresolved import `sys`
--> src\raw.rs:28:5
|
28 | use sys::Termios;
| ^^^ Maybe a missing `extern crate sys;`?
error[E0433]: failed to resolve. Maybe a missing `extern crate sys;`?
--> src\raw.rs:29:5
|
29 | use sys::attr::{get_terminal_attr, raw_terminal_attr, set_terminal_attr};
| ^^^ Maybe a missing `extern crate sys;`?
error[E0425]: cannot find function `get_tty` in this scope
--> src\async.rs:20:36
|
20 | thread::spawn(move || for i in get_tty().unwrap().bytes() {
| ^^^^^^^ not found in this scope
error[E0425]: cannot find function `set_terminal_attr` in this scope
--> src\raw.rs:45:9
|
45 | set_terminal_attr(&self.prev_ios).unwrap();
| ^^^^^^^^^^^^^^^^^ not found in this scope
error[E0425]: cannot find function `get_terminal_attr` in this scope
--> src\raw.rs:90:23
|
90 | let mut ios = get_terminal_attr()?;
| ^^^^^^^^^^^^^^^^^ not found in this scope
error[E0425]: cannot find function `raw_terminal_attr` in this scope
--> src\raw.rs:93:9
|
93 | raw_terminal_attr(&mut ios);
| ^^^^^^^^^^^^^^^^^ not found in this scope
error[E0425]: cannot find function `set_terminal_attr` in this scope
--> src\raw.rs:95:9
|
95 | set_terminal_attr(&ios)?;
| ^^^^^^^^^^^^^^^^^ not found in this scope
Aaah! nevermind. I checkedout windows branch. it compiles on git bash now.
I think you should try this with git-bash and you'll see that all examples work. Maybe this can be merged to redox-os/termion for git-bash support on windows?
Is there any other terminal/shell you want me to check this on? I've got a Windows 2008 server machine.
@fasihrana: I don't think that the windows
branch is ready for primetime yet. Most of the examples function, but not fully. There's also the design problem of enabling the ANSI functionality on Windows 10, which we kludge into working right now but I believe we should use typestate for. See the checklists above -- some things might be checkable based on how well things are already working, so if you see something specifically that isn't actually broken then please report it!
Examples that work are:
Same result as above for plain Bash.exe found in Git-Windows installation.
@fasihrana: If you're interested in continuing this discussion, let's take it to the Riot room I've made: https://riot.im/app/#/room/#erichdongubler-termion:matrix.org
init
didn't need to have its return value held (oops!)get_tty
function: https://github.com/ErichDonGubler/termion/issues/2termion
's design to introduce library initialization and cleanup using astruct
of some kind: https://github.com/ErichDonGubler/termion/issues/11cmd.exe
conemu
rainbow
still broken incmd
, why? Maybe colors support?rainbow
break if keys are pressed too quicklyclick
can panic with anInvalidDigit
value if clicking is too fast, why?color
doesn't show italics incmd
, why? Probably normal, just need to confirm.is_tty
simply panics. Wat!size
panics with MSYS2/Cygwin, why?truecolor
behavior different between MSYS2/Cygwin andcmd
, what should the behavior BE?stdin
FIXME
,XXX
,TODO
, etc. commentsinit
is required for Windows -- in fact, Windows is the reason that it exists. It'd be nice if we could enforce other platforms' initialization too, for consistency.