Giter Club home page Giter Club logo

Comments (7)

TimonPost avatar TimonPost commented on May 20, 2024

Thanks for creating the issue. This should be screen specific I need. However it is supposed to do that. I'll give it a look why this is not happening.

from crossterm.

TimonPost avatar TimonPost commented on May 20, 2024
    let screen = crossterm::Screen::default();
    match screen.enable_alternate_modes(false) {
        Ok(alternative) => {
            let ct = crossterm::Crossterm::from_screen(&alternative.screen);
            let cursor = ct.cursor();
            cursor.hide();
        }
        Err(e) => {}

I can't find why this would occur. I tested in on windows and got the same result as you. I still need to give it a test on a UNIX based machine and see if it is the same there. Also, I might chek if termion has the same problem.

from crossterm.

imdaveho avatar imdaveho commented on May 20, 2024

I think this issue is due to not restoring the previous console/terminal settings on shutdown. When applying syscalls to hide or show cursor, it needs to be reversed on exit -- checkout termbox-go's implementation.

from crossterm.

TimonPost avatar TimonPost commented on May 20, 2024

yes, that might be true. Did you check this for Unix systems? For WinApi it also seems like it operates terminal based and not screen based.

from crossterm.

imdaveho avatar imdaveho commented on May 20, 2024

I didn't check exactly on Unix systems, but looking at termbox-go: https://github.com/nsf/termbox-go/blob/master/api.go#L129

Notice how the code, upon closing, re-establishes some default state like showing the cursor back into stdout. Not sure if Unix-y systems has an equivalent to winapi's GetConsoleState, but it would be preferable to restore the preexisting state, rather than overwriting state (even if they are sane defaults)

from crossterm.

TimonPost avatar TimonPost commented on May 20, 2024

Ah, oke. It is just resetting everything back to default.

from crossterm.

TimonPost avatar TimonPost commented on May 20, 2024

Closing in favor of https://github.com/TimonPost/crossterm/issues/new

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.