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

Returning to clifm prompt after suspending a running job by sending the suspend character (Ctrl+Z) #275

Open
whatbh opened this issue Mar 28, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@whatbh
Copy link

whatbh commented Mar 28, 2024

Describe the bug
In a shell, sending the suspend character (Ctrl+Z) will suspend the currently running job and return to the shell prompt. In clifm, pressing Ctrl+Z will not return to clifm prompt but put it into an unusable state.

To Reproduce
Steps to reproduce the behavior:

  1. In clifm, run a program in foreground (top, ping, glxgears, nautilus, whatever...)
  2. Press Ctrl+Z (to send suspend character) to suspend it.

Expected behavior
Suspend the program and return to the clifm prompt.

Screenshots
Screenshot 2024-03-28 160435

Desktop (please complete the following information):

  • OS: Linux (EndeavourOS)
  • Terminal: qterminal
  • CliFM version: 1.18
  • Installation source: AUR
@leo-arch leo-arch added the bug Something isn't working label Mar 28, 2024
@leo-arch
Copy link
Owner

Hi @whatbh.

Ctrl-z for external commands was disabled in 8325919. Of course this is not a solution, but at least it won't let the shell in an unusable state anymore.

@fidodido48
Copy link

The bug is still present in v. 1.20 on Arch.
Hangs whole clifm and no way to get back control of it.
Is this gonna be fixed?

@leo-arch
Copy link
Owner

leo-arch commented Sep 28, 2024

Hi @fidodido48. What command are you running exactly? It seems to happen only with specific commands. For example, it does happen with top, but not with ping, glxgears, or htop.

@fidodido48
Copy link

Hello. Ive tried to suspend rsync for a while.

<0> $ rsync-move 3 6 ~/DLDIR/YTV/SC2/
sending incremental file list
NA.ESL SC2 Masters - B stream: Winter 2023 Regionals Day 6 - Swiss Round 3.mp4
          5,97G 100%    8,05MB/s    0:11:47 (xfr#1, to-chk=1/2)
NA.ESL SC2 Masters: Summer 2023 Finals Day 1 - Winners Stage - Stream B.mp4
         10,10G 100%    3,14MB/s    0:51:10 (xfr#2, to-chk=0/2)
^Z

And it just hangs like that.

@leo-arch
Copy link
Owner

Suspend is disabled because clifm does not do job control. Are you sure it is hanged? Try with Control-C to kill the program and see whether it is responsive or not.

@fidodido48
Copy link

Its not responding - just prints '^C'.
Have to kill clifm process from other terminal.
This leaves a rsync-zombie process.

@leo-arch
Copy link
Owner

leo-arch commented Sep 28, 2024

Ok. I'll keep investigating this issue. I'm not sure why this happens with some programs and not with others.

This is what we know thus far: Ctrl-z is definitely disabled, but some programs (rsync, top) do not like it and do not even allow you to kill the process via a signal (Ctrl-c), while others (ping, xlgears, htop) behave as expected: Ctrl-z is ignored and they just continue running.

I also observed that this depends at some point on the underlying shell. For example, if you run clifm using zsh (CLIFM_SHELL=/bin/zsh clifm), ping misbehaves just as top, while this does not happen if you use bash, dash, or ksh.

@fidodido48
Copy link

If anyone needs it - from other terminal:
pkill -CONT <suspended_process_name>
Worked on ping and top.

@leo-arch
Copy link
Owner

I've found out that the issue can be reproduced independently of clifm. For example:

exec sh -cm top

where -m means: SIGTTIN, SIGTTOU, and SIGTSTP signals shall be ignored (from the sh manpage).

Again, since this doesn't happen with htop, among others, I assume that the issue is related to how the exec'd program behaves when SIGTSTOP (Ctrl-z) is ignored, and not (or at least not directly) to clifm itself.

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

No branches or pull requests

3 participants