Comments (12)
Yes, thank you!
The test application runs and prints terminal size without any any issue.
Issue can be closed.
from crossterm.
Release has been done you can upgrade to 0.5.4
from crossterm.
It is probably a bug, please go back to 0.5.1 for now. I had a similar error while developing. However, I fixed this in 0.5.3. Are you sure you are using 0.5.3? I had this bug solved there since it occurred in 0.5.2. 0.5.2 has been yanked.
Is let term = crossterm::terminal::terminal();
the only code you ran?
I tested in on windows 10 and for me, it seems to be working.
from crossterm.
For your case Windows 7 I suggest to go back a version, I've gotta install a Virtual machine first if I want to debug that.
from crossterm.
I saw 0.5.3
in Cargo.lock. As I mention in the original post, I use Windows 7 that is not in the list of OSes that must work (you mentioned only Win8 and Win10).
Is let term = crossterm::terminal::terminal(); the only code you ran?
No, it is the first call to crossterm and them it exits with panic. Next calls are request for terminal size and setting font colors.
from crossterm.
Cool! I tested some time ago on Windows 7 too. So should suppose to work. I will do some research now. Note that Windows 7 and 8 are having limits to the size. Could you please post the first 10 lines or something where the error is been thrown?
from crossterm.
stack backtrace:
0: std::sys::windows::backtrace::unwind_backtrace
at libstd\sys\windows\backtrace/mod.rs:104
at libstd\sys\windows\backtrace/mod.rs:95
1: std::sys_common::backtrace::print
at libstd\sys_common/backtrace.rs:71
at libstd\sys_common/backtrace.rs:59
2: std::panicking::default_hook::{{closure}}
at libstd/panicking.rs:211
3: std::panicking::default_hook
at libstd/panicking.rs:227
4: std::panicking::rust_panic_with_hook
at libstd/panicking.rs:476
5: std::panicking::continue_panic_fmt
at libstd/panicking.rs:390
6: rust_begin_unwind
at libstd/panicking.rs:325
7: core::panicking::panic_fmt
at libcore/panicking.rs:77
8: core::result::unwrap_failed
at libcore/macros.rs:26
9: <core::result::Result<T, E>>::unwrap
at libcore/result.rs:808
10: crossterm::kernel::windows_kernel::ansi_support::try_enable_ansi_support::{{closure}}
at C:\Users\vvm\.cargo\registry\src\github.com-1ecc6299db9ec823\crossterm-0.5.3\src\kernel\windows_kernel/ansi_support.rs:17
11: std::sync::once::Once::call_once::{{closure}}
at libstd\sync/once.rs:230
12: std::sync::once::Once::call_inner
at libstd\sync/once.rs:397
13: std::sync::once::Once::call_once
at libstd\sync/once.rs:230
14: crossterm::kernel::windows_kernel::ansi_support::try_enable_ansi_support
at C:\Users\vvm\.cargo\registry\src\github.com-1ecc6299db9ec823\crossterm-0.5.3\src\kernel\windows_kernel/ansi_support.rs:15
15: crossterm::common::functions::get_module
at C:\Users\vvm\.cargo\registry\src\github.com-1ecc6299db9ec823\crossterm-0.5.3\src\common/functions.rs:71
16: crossterm::modules::terminal::terminal::Terminal::new
at C:\Users\vvm\.cargo\registry\src\github.com-1ecc6299db9ec823\crossterm-0.5.3\src\modules\terminal/terminal.rs:32
17: crossterm::modules::terminal::terminal::terminal
at C:\Users\vvm\.cargo\registry\src\github.com-1ecc6299db9ec823\crossterm-0.5.3\src\modules\terminal/terminal.rs:177
18: colortest::main
at src/main.rs:9
from crossterm.
it is output for simple application:
use crossterm;
fn main() {
let term = crossterm::terminal::terminal();
println!("{:?}", term.terminal_size());
}
from crossterm.
I think I know why this is happening. It has to do with the error handling update I did. Currently for terminal_size() I kept the unwrap(). For now, I recommend staying at 0.5.1 for windows 7 or 8. I'll be updating a patch soon.
from crossterm.
Could you try using bug_fix
branch as a dependency to your program and see if it is working?
[dependencies]
crossterm= { git = "https://github.com/TimonPost/crossterm", branch = "bug_fix" }
I did a fix wich should solve the problem.
from crossterm.
I'll be releasing 0.5.4 with the bugfix soon! Thanks for helping out!
from crossterm.
Thanks! The new release works great on Window 7
from crossterm.
Related Issues (20)
- Support OSC 52 for clipboard interraction HOT 1
- Support win32-input-mode
- `crossterm::event::poll` function fails on macOS with a timeout larger than 100 million seconds
- serde support for Attributes
- add support for win32-input-mode
- Synchronized Update doesn't work on Windows
- Support Pixel Coordinates in Mouse Events HOT 1
- Macros to reduce the syntactic burden of parsing events HOT 4
- Mouse down event isn't registered when it happened shortly after another click (double click)
- Document buffering behavior for events
- inconsistent and incorrect touch behaviour HOT 1
- available_color_count is wrong on Windows HOT 1
- Build break from #862
- Build error with use-dev-tty HOT 5
- * `use-dev-tty` is useless without `events`
- crossterm::terminal::size() returns Ok((0, 0)) in eshell
- Capture additional keys (Media keys, caps lock, etc.)
- Feature request: uefi support
- Can not capture `MediaKeyCode`s
- Color names
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crossterm.