Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ncspot does not close when terminal is closed #1309

Closed
maru-sama opened this issue Oct 11, 2023 · 2 comments
Closed

ncspot does not close when terminal is closed #1309

maru-sama opened this issue Oct 11, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@maru-sama
Copy link

Describe the bug
The last commit a067ab2 seems to break the way ncspot handles a SIGTERM. If I close the terminal ncspot continues to run and I have to kill it. Reverting this commit fixes this issue.

To Reproduce
Steps to reproduce the behavior:

  1. Open ncspot in a terminal
  2. Close the terminal
  3. ncspot does not close

Expected behavior
ncspot should close as well, when the terminal is closed.

System (please complete the following information):

  • OS: Linux
  • Terminal: GNOME Terminal. kitty
  • Version: Master branch
  • Installed from: Compiled
@maru-sama maru-sama added the bug Something isn't working label Oct 11, 2023
hrkfdn added a commit that referenced this issue Oct 11, 2023
While this probably reintroduces the crashes it should handle `SIGHUP` again
which currently leads into the `unreachable!()` branch.

Fixes #1309
@hrkfdn
Copy link
Owner

hrkfdn commented Oct 11, 2023

Hey, thanks for the report. Can you let me know if it changes with the changes in #1310?

@hrkfdn
Copy link
Owner

hrkfdn commented Oct 14, 2023

Duplicate of #1282 - it shouldn't stay open anymore but will cause a panic! when closing.

@hrkfdn hrkfdn closed this as not planned Won't fix, can't repro, duplicate, stale Oct 14, 2023
dricottone added a commit to dricottone/ncspot that referenced this issue Jan 10, 2024
Commit a067ab2: feat: move to async POSIX signal handler
Instead of trying to handle signals for every step of the `cursive`
event loop, move the signal handling into its own asynchronous task and
send callbacks to `cursive` when a signal arrives.

PR 1305: fix: restore SIGHUP in signal handler
Restore the SIGHUP signal handler which was accidentally removed in a067ab2.

The commit had to be reverted and the PR was closed.

Commit a1a9863: Revert "feat: move to async POSIX signal handler"

ThomasFrans commented: From what I can see, it's an issue introduced by the
crossterm backend. The ncurses one doesn't keep the process running. Currently
I suspect Cursive is doing a write to /dev/tty which is closed, and that write
blocks on the crossterm backend and returns immediately on the ncurses backend.
I guess it could be resolved by switching the default backend (again)?
This would solve hrkfdn#1309 and hrkfdn#1310 and hrkfdn#1282. I'd love to hear thoughts
on this idea. If it's an OK solution, I'd try to see whether I can open an
issue at Cursive or Crossterm to resolve the issue there, and meanwhile switch
backend and add the SIGHUP handler back to finally close all these issues

A commit to deprecate the crossterm/pancurses/termion backends will follow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants