Skip to content

Re-enable cursor in signal handlerย #309

@hpjansson

Description

@hpjansson

Brought up by @saitoha in #307.

If we disabled the cursor on startup (i.e. --polite off or auto), and the user issues a SIGINT (ctrl-c), we currently wait until chafa can handle the interrupt flag and reenable the cursor on exit. However, if it's stuck on CPU or I/O, this can take a while, and if the user gets impatient and hits ctrl-c again, the program will abort without reenabling the cursor.

Even if there's not a lot we can do in a signal handler, we can still do a write(). We could thus pregenerate the cleanup string to re-enable the cursor and possibly other settings and write it immediately when the signal arrives and avoid this annoyance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions