Comments (10)
Just built 0.6.pre19 and I can no longer replicate the issue. Thanks for the quick reply and fix!
from oil.
@Wychmire Sorry about that and thanks for testing Oil!
I just committed a fix for this -- it was a build error with the original fix. I plan to make a release shortly and I'll close this bug again once that's done. Let me know if you find any other problems -- they are really useful reports!
from oil.
Same with handling of other terminal signals (^Z).
from oil.
Thanks good point. Yes OSH isn't doing any signal handling at all right now.
I forget exactly how it works but I think we have to change the session group when starting a process. That way signals only get delivered to cat and not to osh.
I have to implement the trap
builtin too so this could be done at the same time.
from oil.
I forget exactly how it works but I think we have to change the session group when starting a process.
Yup pretty sure you need a setsid(2)
.
from oil.
As an aside, if OSH is the login shell for an ssh connection, ^C kills OSH and closes the connection.
from oil.
Also mentioned here: https://lobste.rs/s/l8r1nw/why_create_new_unix_shell#c_sfmsrv
from oil.
Hm I fixed the Ctrl-C issue by registering a handler for SIGINT, but it looks like SIGSTOP is special and you can't register a handler for it.
I am not sure exactly how it works.
BTW I'm pretty sure setsid()
is supposed to be called by the login program that starts the shell, not the shell itself. I grepped the source code of bash and dash, and strace'd them, and they don't appear to call it.
Let me file a new bug for Ctrl-C.
from oil.
Ctrl-C now displays ^C instead of exiting.
http://www.oilshell.org/release/0.6.pre16/
The crash was fixed a long time ago, but sorry I didn't get the bash behavior until recently! I thought it required replacing Python's signal module, but it turns out it didn't.
I didn't need to use setsid() -- apparently shells just handle the signal themselves and then change the process state when forking children.
Thanks for the report! Keep them coming.
from oil.
This is still happening on 0.6.pre18. I can replicate it consistently with the commands in the OP and when running yay
. I do get a traceback, maybe it can be useful.
Traceback (most recent call last):
File "/home/andy/git/oilshell/oil/bin/oil.py", line 766, in _cpython_main_hook
File "/home/andy/git/oilshell/oil/bin/oil.py", line 748, in main
File "/home/andy/git/oilshell/oil/bin/oil.py", line 722, in AppBundleMain
File "/home/andy/git/oilshell/oil/bin/oil.py", line 534, in ShellMain
File "/home/andy/git/oilshell/oil/core/main_loop.py", line 114, in Interactive
File "/home/andy/git/oilshell/oil/osh/cmd_exec.py", line 1234, in ExecuteAndCatch
File "/home/andy/git/oilshell/oil/osh/cmd_exec.py", line 1182, in _Execute
File "/home/andy/git/oilshell/oil/osh/cmd_exec.py", line 1127, in _Dispatch
File "/home/andy/git/oilshell/oil/osh/cmd_exec.py", line 596, in RunSimpleCommand
File "/home/andy/git/oilshell/oil/core/process.py", line 621, in Run
File "/home/andy/git/oilshell/oil/core/process.py", line 593, in WaitUntilDone
File "/home/andy/git/oilshell/oil/core/process.py", line 865, in Wait
AttributeError: 'module' object has no attribute 'WTERMSIG'
FATAL: couldn't import from app bundle '/usr/local/bin/oil.ovm' (1)
Stripping the oil.ovm binary may cause this error.
See https://github.com/oilshell/oil/issues/47
from oil.
Related Issues (20)
- command -v "$emptyvar" returns zero HOT 3
- Oils 0.23.0 TODO
- Missing "Str=>lower()"
- Abort with += on missing dict key
- intermittent crash running amd-test script -- reproducible in dbg, opt HOT 4
- OpenBSD doesn't have RLIMIT_AS
- Add pp [x + 42] to print an expression and its value - like Rust dbg!() HOT 2
- github URL pastebin HOT 8
- bash allows pasting multi-line code snippets, but OSH/YSH don't HOT 3
- allow backspace from multiline expressions HOT 1
- allow any custom prompts HOT 2
- typeof / reflection / assign results of '=' HOT 3
- emoji/unicode identifiers
- Setting up GNU readline history HOT 1
- 'view latest' released version in documentation - because old links are often surfaced HOT 1
- crash in parsing return HOT 1
- BashArray could have a sparse representation (ble.sh)
- bash SHELLOPTS and BASHOPTS support
- pitfall - IFS= read x doesn't set x (read --raw-line or for <> loop instead) HOT 6
- Fatal error when closing stderr on a non-fatal error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oil.