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

Ctrl-C causes Interrupted system call #2108

Open
yurivict opened this issue Oct 25, 2024 · 5 comments
Open

Ctrl-C causes Interrupted system call #2108

yurivict opened this issue Oct 25, 2024 · 5 comments

Comments

@yurivict
Copy link

$ osh
osh-0.23.0$ ^Coils I/O error (main): Interrupted system call

Version: 0.23.0
OS: FreeBSD 14.1

@andychu
Copy link
Contributor

andychu commented Oct 28, 2024

Thanks for the report!

I have noticed this on OS X too -- Not sure why it's different than Linux

@andychu
Copy link
Contributor

andychu commented Oct 28, 2024

Suspicions for this bug

  • try with Linux and ./configure --without-readline
  • maybe related to sigaction() differences?
  • or even GNU readline differences

I will look into this

@andychu
Copy link
Contributor

andychu commented Oct 29, 2024

OK yes I can repro this on Linux when GNU readline isn't present

$ _bin/cxx-opt-sh/osh
Warning: Can't set option 'vi' because shell wasn't compiled with GNU readline
[osh] hoover ~/src/oils/oils-for-unix-0.23.0$ ^Coils I/O error (main): Interrupted system call

Hmmm

@andychu
Copy link
Contributor

andychu commented Oct 29, 2024

Also I wonder if we should get rid of the vi error message, and move it to --version and such

andychu pushed a commit that referenced this issue Oct 29, 2024
Because mylib::Stdin()->readline() needs to raise KeyboardInterrupt!

Signal handling is inherently part of the mycpp runtime.

Related to issue #2108.
andychu pushed a commit that referenced this issue Oct 29, 2024
This is issue #2108.

CFile::readline() now throws KeyboardInterrupt, like other read()
functions.

There is still an issue with ^C, probably because of some terminal
settings.
@andychu
Copy link
Contributor

andychu commented Oct 29, 2024

I just fixed this - thanks for the report!

There needs to be some more polishing in the non-GNU-readline case

andychu pushed a commit that referenced this issue Oct 29, 2024
- in the GNU readline case, it avoids a drawing bug
- in the non-GNU readline case, it avoids ^C being printed twice - the
  terminal driver prints it too, I think

This isn't ideal -- the 2 cases should be made consistent -- but it's
better than what we had.

This is fallout from issue #2108.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants