Giter VIP home page Giter VIP logo

Comments (12)

VladimirMarkelov avatar VladimirMarkelov commented on July 4, 2024 1

Yes, thank you!

The test application runs and prints terminal size without any any issue.

Issue can be closed.

from crossterm.

TimonPost avatar TimonPost commented on July 4, 2024 1

Release has been done you can upgrade to 0.5.4

from crossterm.

TimonPost avatar TimonPost commented on July 4, 2024

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.

TimonPost avatar TimonPost commented on July 4, 2024

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.

VladimirMarkelov avatar VladimirMarkelov commented on July 4, 2024

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.

TimonPost avatar TimonPost commented on July 4, 2024

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.

VladimirMarkelov avatar VladimirMarkelov commented on July 4, 2024
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.

VladimirMarkelov avatar VladimirMarkelov commented on July 4, 2024

it is output for simple application:

use crossterm;
fn main() {
    let term = crossterm::terminal::terminal();
    println!("{:?}", term.terminal_size());
}

from crossterm.

TimonPost avatar TimonPost commented on July 4, 2024

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.

TimonPost avatar TimonPost commented on July 4, 2024

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.

TimonPost avatar TimonPost commented on July 4, 2024

I'll be releasing 0.5.4 with the bugfix soon! Thanks for helping out!

from crossterm.

VladimirMarkelov avatar VladimirMarkelov commented on July 4, 2024

Thanks! The new release works great on Window 7

from crossterm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.