Giter Club home page Giter Club logo

Comments (11)

kdheepak avatar kdheepak commented on May 26, 2024

Do you mean after hitting Ctrl+C?

from terminaluserinterfaces.jl.

ExpandingMan avatar ExpandingMan commented on May 26, 2024

Nope, just normal exiting. In one of your examples, it's q to break the loop, even hitting q lands me in this issue.

from terminaluserinterfaces.jl.

kdheepak avatar kdheepak commented on May 26, 2024

Are you calling TUI.initialize()?

function initialize()
backup_termios()
tui_mode()
hide_cursor()
enable_raw_mode()
clear_screen()
move_cursor_home()
end
function cleanup()
move_cursor_home()
clear_screen()
disable_raw_mode()
show_cursor()
default_mode()
end

TUI.initialize() does the following:

  1. Backs up termios settings for restore
  2. Switches to tui_mode(), i.e. switches to the alternate terminal buffer
  3. Hides the cursor
  4. Enables the raw mode
  5. Clears the alternate terminal buffer screen
  6. Moves the cursor to the first row first column

One TUI.initialize() is called, since you are in raw mode, it'll consume all key presses without echoing them back. TUI.cleanup() undoes the above, you should should now be in the same state as you were before calling TUI.initialize().

I'm not surprised that that when you don't call TUI.cleanup(), you are seeing a "dead" terminal. You can call any of those functions in the cleanup manually too btw.

When you hit q and call TUI.cleanup(), does the cursor show? Are you still in the alternate buffer?

from terminaluserinterfaces.jl.

ExpandingMan avatar ExpandingMan commented on May 26, 2024

Yup, I'm literally just running your examples. Yes, I do see the cursor after quitting normally with q and call TUI.cleanup(). Note that this issue does not seem to depend on how I exit, in the list example, it happens even if I choose an option. I do indeed see the normal output as expected, everything looks normal, I just can't do anything. (So presumably I'm no longer in the alternate buffer.)

Note that I have just tried this on a different computer, just for the hell of it. Both are in alacritty in linux, but figured I'd try it for the hell of it.

If I had to guess, I'd say this isn't getting out of raw mode for some reason, but I have no idea why.

from terminaluserinterfaces.jl.

kdheepak avatar kdheepak commented on May 26, 2024

Yeah it does seem like a bug in the termios restore. I’m just trying to figure out what that is. When you are in that β€œdead” state, what happens if you type reset and hit Enter?

from terminaluserinterfaces.jl.

kdheepak avatar kdheepak commented on May 26, 2024

Note for myself, this is potentially related to this issue: kdheepak/TERMIOS.jl#6

from terminaluserinterfaces.jl.

ExpandingMan avatar ExpandingMan commented on May 26, 2024

Typing reset and then enter in the "dead" state does not seem to do anything.

from terminaluserinterfaces.jl.

rfourquet avatar rfourquet commented on May 26, 2024

I think I'm hitting the same problem. More specifically, when running an example like julia examples/barchart.jl on the command line, there is no problem, but when I include the file from within the Julia REPL, my whole screen goes "dead" (after quitting the TUI app with q), and I have to kill the julia process. Do you know of a trick to get out of the dead state without having to kill julia?

from terminaluserinterfaces.jl.

Cyrannosaurus avatar Cyrannosaurus commented on May 26, 2024

copying the code examples straight from GitHub and pasting in the REPL also leads to the REPL freezing/dying. Everything works while in the example until using 'q'. The program exits, I'm back in REPL, and cannot do anything but terminate the process.

from terminaluserinterfaces.jl.

kdheepak avatar kdheepak commented on May 26, 2024

Can you tell me what terminal / operating system?

from terminaluserinterfaces.jl.

kdheepak avatar kdheepak commented on May 26, 2024

Can someone who has had this issue try it again in v0.3.0:

https://github.com/kdheepak/TerminalUserInterfaces.jl/releases/tag/v0.3.0

It should be resolved now (I've updated the examples too, there's no longer a TUI.initialize()).

from terminaluserinterfaces.jl.

Related Issues (15)

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.