Git Product home page Git Product logo

Comments (4)

jart avatar jart commented on July 24, 2024 3

Thanks for the report. It seems what was happening is that the virtual processing terminal mode was persisting across processes. I've now fixed things so that exit() will restore the console mode. You can download the latest binaries here: https://justine.lol/redbean/index.html and https://justine.lol/cosmopolitan/download.html

from cosmopolitan.

lduguid avatar lduguid commented on July 24, 2024

After you run it, you can no longer use the arrow keys to go to the previous command, instead it prints the control characters: ^[[A

same issue on my machine. build on WSL2, run in WSL2 - OK, run in win32 CMD.exe - as above.

from cosmopolitan.

alisonatwork avatar alisonatwork commented on July 24, 2024

A temporary workaround for this is to run in a Powershell console, where this doesn't happen, or just run CHCP 437 after running the APE binary. It seems like it's not resetting the code page after changing it to 65001 (UTF-8) in https://github.com/jart/cosmopolitan/blob/master/libc/runtime/winmain.greg.c.

See also https://ss64.com/nt/chcp.html for more on CHCP.

Edit to add: actually, it seems you can just run CHCP with no arguments to stay in UTF-8 code page, but somehow this resets the console state so that arrow keys work again 🤷

from cosmopolitan.

spullara avatar spullara commented on July 24, 2024

It looks like we ought to grab the codepage at the beginning and then restore it on exit. I'll take a look at doing that and see if that is what is causing it. It worries me that it got fixed without resetting the codepage. Maybe there is something else that needs to be reset.

from cosmopolitan.

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.