[PR #473] [MERGED] TTY/stdin/stdout handling improvements #474

Closed
opened 2026-02-25 20:33:50 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/asciinema/asciinema/pull/473
Author: @ku1ik
Created: 2/20/2022
Status: Merged
Merged: 2/20/2022
Merged by: @ku1ik

Base: developHead: tty-in-out


📝 Commits (5)

  • 24dba63 Typing improvements
  • a946d3e Dedicated function to build metadata
  • 6a33b6a Explicitly use tty for input/output instead of process' stdin/stdout
  • 81cf523 Forward asciinema's stdin to recorded process
  • bc7bbb3 Don't use colors when asciinema's stdout/stderr is not a tty

📊 Changes

4 files changed (+96 additions, -41 deletions)

View changed files

📝 asciinema/__init__.py (+0 -2)
📝 asciinema/commands/command.py (+17 -5)
📝 asciinema/pty_.py (+12 -0)
📝 asciinema/recorder.py (+67 -34)

📄 Description

  • use real tty (/dev/tty) instead of asciinema's stdin/stdout for recorded process' input/output - allows redirecting asciinema output (logger) while keeping recorded process' output visible
  • fallback to /dev/null for input/output when tty is not available (when recording headless)
  • don't use esc sequences (colors) in logger when asciinema's own output is redirected to a file/pipe
  • forward asciinema's own stdin to recorded process - allows driving interactive programs in headless mode

🔄 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/473 **Author:** [@ku1ik](https://github.com/ku1ik) **Created:** 2/20/2022 **Status:** ✅ Merged **Merged:** 2/20/2022 **Merged by:** [@ku1ik](https://github.com/ku1ik) **Base:** `develop` ← **Head:** `tty-in-out` --- ### 📝 Commits (5) - [`24dba63`](https://github.com/asciinema/asciinema/commit/24dba63605604947828e062a3f947f60a1738905) Typing improvements - [`a946d3e`](https://github.com/asciinema/asciinema/commit/a946d3e7a029e90dcf8f25ede9ddc10c6207c8e0) Dedicated function to build metadata - [`6a33b6a`](https://github.com/asciinema/asciinema/commit/6a33b6a0e66a3c8efec68dadb4f16ebfb633db05) Explicitly use tty for input/output instead of process' stdin/stdout - [`81cf523`](https://github.com/asciinema/asciinema/commit/81cf52306be90476df3ae11352f58b9268d0b518) Forward asciinema's stdin to recorded process - [`bc7bbb3`](https://github.com/asciinema/asciinema/commit/bc7bbb3c7829ac6d69993ebb9cc6ff418d20773d) Don't use colors when asciinema's stdout/stderr is not a tty ### 📊 Changes **4 files changed** (+96 additions, -41 deletions) <details> <summary>View changed files</summary> 📝 `asciinema/__init__.py` (+0 -2) 📝 `asciinema/commands/command.py` (+17 -5) 📝 `asciinema/pty_.py` (+12 -0) 📝 `asciinema/recorder.py` (+67 -34) </details> ### 📄 Description - use real tty (/dev/tty) instead of asciinema's stdin/stdout for recorded process' input/output - allows redirecting asciinema output (logger) while keeping recorded process' output visible - fallback to /dev/null for input/output when tty is not available (when recording headless) - don't use esc sequences (colors) in logger when asciinema's own output is redirected to a file/pipe - forward asciinema's own stdin to recorded process - allows driving interactive programs in headless mode --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-25 20:33:50 +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#474
No description provided.