You are not logged in.
Hi,
On random occasions my terminal will hang after command completes. There is no pattern, but if I would have to approximate it happens every 10th command.
This started to occur after I fully upgraded my system.
e.g. after inserting command:
gpg --keyserver keys.gnupg.net --recv-keys 8F0871F202119294or
python a.pythe command would execute but the terminal would hang and it would require me to press control+C in order to continue (or wait for 10-20 seconds).
The terminal does not freeze - it seems that it is waiting for something. I am certain that command does complete; for example if last line of code in my a.py script outputs a file, the file will be created, but terminal would still hang.
I don't know where to start debugging or what could cause those issues.
This is output of uname -a, I will gladly provide any additional information.
Linux janko-pc 4.12.4-1-ARCH #1 SMP PREEMPT Fri Jul 28 18:54:18 UTC 2017 x86_64 GNU/LinuxThe terminal I am using is Terminator. (1.91-5)
Last edited by jkovacevic (2017-08-09 08:31:48)
Offline
Which shell (bash, zsh, ...)?
What happens with input to the "hanging" terminal? (direct output, or later or not at all?)
Does simply pressing "Enter" "unfreeze" the teminal as well? (or entering eg. ls)
Online
When a command hangs, attach strace to the process to see what it's waiting for.
This is an example of me running cat in one terminal, then attaching to it in another:
$ pgrep -a cat
28796 cat
$ sudo strace -p 28796
strace: Process 28796 attached
read(0, Here I can see that it remains "blocked" on the read system call (which makes sense, because it waits for input on stdin).
Offline
Which shell (bash, zsh, ...)?
What happens with input to the "hanging" terminal? (direct output, or later or not at all?)
Does simply pressing "Enter" "unfreeze" the teminal as well? (or entering eg. ls)
This is how my shell (zsh) looks like when before entering any command:
jk@janko-pc /tmp >When I enter command, wait for it to complete and my shell hangs, pressing enter just positions my cursor to blank newline - I will not get input as above.
I should test whether entering ls command will get executed after my shell unfreezes - but I cannot replicate the bug.
When a command hangs, attach strace to the process to see what it's waiting for.
This is an example of me running cat in one terminal, then attaching to it in another:
$ pgrep -a cat 28796 cat $ sudo strace -p 28796 strace: Process 28796 attached read(0,Here I can see that it remains "blocked" on the read system call (which makes sense, because it waits for input on stdin).
Thank you, this is useful. When I manage to freeze my terminal again I will experiment with this.
Offline
My money is on Oh-My-Zshit.
Offline
My money is on Oh-My-Zshit.
I will try and reinstall it. Are there any better alternatives with out of the box autocompletion?
By the way I managed to replicate it. I believe it has a chance to occurs when I execute never executed command?
I am trying to record video of it, but catching it is so random.
Offline
+1 for removing OMZ, it is well known to be buggy code.
Vanilla zsh has out of the box autocompletion.
Offline
Anything is a better alternative than that steaming pile of crap.
Remove it and see if that fixes your issue.
Offline
@Jason, why do you think I've asked for the shell ;-)
@jkovacevic, zsh does autocompletion by itself - you don't need OMZ at all. If you want a useful pre-config, try the grml-zsh-config package, but you should familarize yourself with the shell settings/features on top of this (if you intend intense usage of the textshell)
Online
Thank you all, removing OMZ and installing zsh with grml-zsh-config fixed the issue! Thread can be closed.
Offline
Threads don't get closed, it's up to you to mark it as [SOLVED]...
Offline