Coder Social home page Coder Social logo

Comments (6)

pzmarzly avatar pzmarzly commented on July 24, 2024

At first I thought it may be a bug in crossterm::Terminal::exit() but it's just a wrapper for std::process::exit(0). Could you try running:

irust && stty sane
irust && tput clear
irust && tput reset

Hopefully at least 1 of these commands should help, and knowing which one does should help sigmaSd fix the issue.

from irust.

tobz1000 avatar tobz1000 commented on July 24, 2024

Thanks! stty sane and tput reset fix the issue (only one is needed). tput clear doesn't make any difference. Hopefully that helps with a diagnosis...

Let me know if you'd like any more testing.

from irust.

sigmaSd avatar sigmaSd commented on July 24, 2024

Hi @tobz1000 @pzmarzly, I should hopefully have time to look into it tomorrow,
thx for helping @pzmarzly!

from irust.

sigmaSd avatar sigmaSd commented on July 24, 2024

@tobz1000 can you try 5fe3a57
Its weird that this fixes it, since terminal.exit() does the same thing, I'll probably dig deeper
Edit: Nvm I imagined that terminal.exit() stops the raw mode, guess it doesn't, now everything make sense^^

from irust.

tobz1000 avatar tobz1000 commented on July 24, 2024

Yep - the patch fixes it, thanks!

Yeah, Terminal::exit is a bit of weird one, pretty much a re-export of sys::exit. But I guess since Terminal doesn't own/know about any RawScreen, it doesn't try to guess the current or previous terminal state.

It seems like it would be cleaner to break out of the control loop and let IRust::run return instead, and relying the RawScreen's Drop implementation to do this instead, but that would require some refactoring.

from irust.

sigmaSd avatar sigmaSd commented on July 24, 2024

@tobz1000 I like your idea! I'll keep it in mind for now

from irust.

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.