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

Remove temporary file on termination signal #81

Open
Tracked by #84
magicant opened this issue Oct 26, 2024 · 0 comments
Open
Tracked by #84

Remove temporary file on termination signal #81

magicant opened this issue Oct 26, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@magicant
Copy link
Owner

Describe the bug

POSIX XCU 1.4 requires in the "Output files" sub-section:

Any temporary file created by the implementation shall be removed by the implementation upon a utility's successful exit, exit because of errors, or before termination by any of the SIGHUP, SIGINT, or SIGTERM signals, unless specified otherwise by the utility description.

Currently, temporary files are not removed if the shell is killed by a signal.

To Reproduce

Steps to reproduce the behavior:

  1. Enable the vi line-editing mode.
  2. On the command line, press Escape to switch to the normal mode and then press v to invoke the command editor.
  3. Send SIGHUP to the shell waiting for the editor to finish.
  4. The signal kills the shell, but the temporary file remains.

Expected behavior

The shell must remove the temporary file then terminate by resending the same signal to itself.
This is the behavior required by POSIX. (See also the "Asynchronous events" sub-section in POSIX XCU 1.4.)

@magicant magicant added the bug Something isn't working label Oct 26, 2024
@magicant magicant mentioned this issue Nov 6, 2024
48 tasks
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

1 participant