Skip to main content

old-stdout

@readwithai - X - blog - machine-aided reading - 📖⚡️🖋️

Get the old output from shell commands, if you use tmux.

This is vibe-coded but will become less so over time.

Motivation

It is quite natural to want to do thigns with the output of a command that you just run without having to rerun. If you have programmatic access to your shell scrollback, by using tmux this allows you to get output.

Alternatives and prior work

You could collect the outputs of previous commands into files using tee.

You could use something like jupyter which matains history.

Usage

Use tmux.

  • oldout will show the output of the previous command.
  • oldout 2 shows you the output from the penultimate command (etc).
  • outdiff shows the difference between the last two outputs

You can use --command with oldout to include the command.

Nonstandard prompts

I use a two line prompt. I therefore provide quite general features ot change the prompt parsing.

Multi-line Prompts

For prompts that span multiple lines, set PROMPT_LENGTH in ~/.config/oldout.py.

# Example two-line prompt:
# ┌─[user@host]─[/current/path]
# └─$ command here

PROMPT_RE = r"^┌─"  # Match the first line of the prompt
PROMPT_LENGTH = 2   # Skip both prompt lines when extracting output

Complex Prompt Patterns

The PROMPT_RE (in ~/.config/oldout.py.) regex can handle unusual prompt formats

# Powerline/fancy prompts with symbols
PROMPT_RE = r"➜\s+\w+"

# Prompts with timestamps
PROMPT_RE = r"^\[\d{2}:\d{2}:\d{2}\]"

# Conditional prompts (different in different directories)
PROMPT_RE = r"(prod|dev|staging)>"

# Prompts with color codes (matches after ANSI sequences)
PROMPT_RE = r"\x1b\[[0-9;]*m.*\$"

About me

I am @readwithai. I create tools for reading, research and agency sometimes using the markdown editor Obsidian.

I also create a stream of tools that are related to carrying out my work.

I write about lots of things - including tools like this - on X. My blog is more about reading and research and agency.

Metadata

Release files for oldout 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for oldout 1.1.0
File Size Uploaded Provenance Actions
oldout-1.1.0.tar.gz 6.9 kB Without provenance Details for oldout-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for oldout 1.1.0
File Interpreter ABI Platform Actions
oldout-1.1.0-py3-none-any.whl Python 3 none any Details for oldout-1.1.0-py3-none-any.whl

Total release size: 15.4 kB

Release files / oldout-1.1.0.tar.gz

Download URL oldout-1.1.0.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
fb5610e182448409760a83c66333f1adca22eba8d98e2fafaf7910c5aa50fcbf
BLAKE2b-256 checksum
How to use checksums
00688eb38e9fd4032f649bf23b1914c27d8e8123a0b8a78ed49139f39f6f28ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / oldout-1.1.0-py3-none-any.whl

Download URL oldout-1.1.0-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
79ea4165cd9ed1f1c025582b16db42f8b577e4d8229599277b6c959391963e2e
BLAKE2b-256 checksum
How to use checksums
747474d8fbdf4e06fa0a5c7c13a2b210fcaaceafed8bd957f1ec0169ec9af888
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for oldout 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page