Skip to content

feature: support no-argument stty() to display current settings#60

Draft
toddr-bot wants to merge 1 commit intomainfrom
koan.toddr.bot/no-arg-stty-display
Draft

feature: support no-argument stty() to display current settings#60
toddr-bot wants to merge 1 commit intomainfrom
koan.toddr.bot/no-arg-stty-display

Conversation

@toddr-bot
Copy link
Copy Markdown
Collaborator

@toddr-bot toddr-bot commented Apr 6, 2026

What

stty() called with no parameters now returns current terminal settings instead of dying.

Why

POSIX specifies that stty with no operands should display the current terminal configuration. The previous behavior (die "No parameters passed to stty") was unfriendly and non-standard. This also makes stty.pl with no arguments print terminal settings (matching GNU stty behavior) instead of dying.

How

Moved the empty-args check from a die at the top of stty() to after the termios read, returning show_me_the_crap() output (same as -a). Non-tty handles still return undef as before (the isatty check runs first).

Testing

  • Added test for no-arg pty call: verifies output matches -a
  • Added test for no-arg non-tty call: verifies undef return (no die)
  • Full suite: 147 tests pass across 11 files
  • POD and POD coverage pass

🤖 Generated with Claude Code


Quality Report

Changes: 3 files changed, 46 insertions(+), 8 deletions(-)

Code scan: clean

Tests: passed (OK)

Branch hygiene: 1 issue(s)

  • Branch is not pushed to remote

Generated by Kōan post-mission quality pipeline

When called with no parameters, stty() now returns the current terminal
settings in human-readable form (equivalent to -a) instead of dying.
This matches POSIX stty behavior where invoking stty with no operands
displays the current configuration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant