shell hangs when `echo` is used
See original GitHub issueSo for the following script
#! /usr/bin/env zxpy
~'echo Hello'
once I executed it, the shell hangs after printing Hello. When I press ctrl+c, I get:
^CTraceback (most recent call last):
File "/usr/local/bin/zxpy", line 8, in <module>
sys.exit(cli())
File "/usr/local/lib/python3.7/site-packages/zx.py", line 59, in cli
run_zxpy(filename, module)
File "/usr/local/lib/python3.7/site-packages/zx.py", line 136, in run_zxpy
"$shlex_quote": shlex.quote,
File "./bug.py", line 3, in <module>
~'echo Hello'
File "/usr/local/lib/python3.7/site-packages/zx.py", line 100, in run_shell_print
sys.stdout.buffer.write(text)
KeyboardInterrupt
Issue Analytics
- State:
- Created 2 years ago
- Comments:17 (9 by maintainers)
Top Results From Across the Web
Shell hangs when assigning command result to a variable
-- you are using command substitution, so as long as the command has not finished execution, substitution cannot be done, because the output...
Read more >bash - simple cat echo process substitution hangs
Your code cat >( echo hola; ) will never get exit because,. it will first echo the pattern hola; And takes the input...
Read more >Echo command hangs when writing to serial device
No prompt appears for approximately 40 seconds, terminal seems to be hanging. What could be the reason for this behaviour? P.S. The serial...
Read more >Weird tee command hang - Korn Shell - Google Groups
I have a small driver Korn Shell program that I use to call programs on my system. ... echo "ERROR: Problems detected with...
Read more >Shell Scripting Crash Course | Linux Certification Training
Linux Admin Certification Training ( Use Code "YOUTUBE20"): https://www.edureka.co/linux-admin Edureka Computer Science Bootcamp ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m guessing you updated it on one python version but not the other?
Anyway, glad that it’s fixed now.
I found a few things about it:
it only happens on macos. Probably why I didn’t catch this issue in my tests.
it has to do with my polling mechanism. It’s not hanging on any single statement, it’s stuck in an infinite loop. If you try to
ctrl+C
many times, you’ll find that it reports a different line every time.I’ll try and fix this ASAP, and keep you updated.