[PR #578] [MERGED] Re-enable default signal handler for SIGPIPE in child process #1128

Closed
opened 2026-03-15 11:20:06 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/asciinema/asciinema/pull/578
Author: @ku1ik
Created: 10/22/2023
Status: Merged
Merged: 10/23/2023
Merged by: @ku1ik

Base: developHead: sig-fdl-in-child


📝 Commits (1)

  • f8e8a95 Re-enable default signal handle for SIGPIPE in child process

📊 Changes

1 file changed (+1 additions, -0 deletions)

View changed files

📝 asciinema/pty_.py (+1 -0)

📄 Description

Fix for #369.

asciinema parent process doesn't set handler for SIGPIPE, which by default sets SIG_IGN for this signal in a child process. This explicitly sets the handler in the child process to SIG_DFL.

This is something script and mosh do right before exec-ing the command in a child process:

script - github.com/util-linux/util-linux@f3fd64111c/term-utils/script.c (L987)
mosh - github.com/mobile-shell/mosh@1105d481bb/src/frontend/mosh-server.cc (L540-L546)

Many thanks to @Low-power for figuring this out 👏


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/asciinema/asciinema/pull/578 **Author:** [@ku1ik](https://github.com/ku1ik) **Created:** 10/22/2023 **Status:** ✅ Merged **Merged:** 10/23/2023 **Merged by:** [@ku1ik](https://github.com/ku1ik) **Base:** `develop` ← **Head:** `sig-fdl-in-child` --- ### 📝 Commits (1) - [`f8e8a95`](https://github.com/asciinema/asciinema/commit/f8e8a95f0a716be908ef9ebe75dde69371e9f829) Re-enable default signal handle for SIGPIPE in child process ### 📊 Changes **1 file changed** (+1 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `asciinema/pty_.py` (+1 -0) </details> ### 📄 Description Fix for #369. asciinema parent process doesn't set handler for SIGPIPE, which by default sets SIG_IGN for this signal in a child process. This explicitly sets the handler in the child process to SIG_DFL. This is something script and mosh do right before exec-ing the command in a child process: script - https://github.com/util-linux/util-linux/blob/f3fd64111c28de1ecd47f7cd519120ffa531800d/term-utils/script.c#L987 mosh - https://github.com/mobile-shell/mosh/blob/1105d481bb9143dad43adf768f58da7b029fd39c/src/frontend/mosh-server.cc#L540-L546 Many thanks to @Low-power for figuring this out :clap: --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-15 11:20:06 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/asciinema#1128
No description provided.