Skip to content

Set interactive automatically even with positional parameters#160

Merged
magicant merged 1 commit into
trunkfrom
auto-interactive
Apr 20, 2025
Merged

Set interactive automatically even with positional parameters#160
magicant merged 1 commit into
trunkfrom
auto-interactive

Conversation

@magicant

Copy link
Copy Markdown
Owner

POSIX.1-2024 changed the wording of the condition under which the shell automatically becomes interactive. There may be some positional parameters as long as the shell is reading commands from the standard input and the standard input and standard error are both connected to a terminal.

Fixes #100

Summary by Copilot

This pull request introduces a change to the behavior of the shell when determining whether to enter interactive mode. The shell now becomes interactive if it is reading commands from standard input and both standard input and standard error are connected to a terminal, regardless of whether a command-line operand is provided. The changes include updates to documentation and source code to reflect this new behavior.

Behavioral Changes:

  • The shell now automatically enters interactive mode if the following conditions are met: the +i (++interactive) option is not specified, the -s (--stdin) option is specified (explicitly or implicitly), and both standard input and standard error are connected to a terminal. Previously, this behavior required no command-line operand as well. (yash.c: yash.cL206-R206)

Documentation Updates:

  • Updated doc/invoke.txt to describe the new conditions under which the shell becomes interactive. (doc/invoke.txt: doc/invoke.txtR59-R65)
  • Updated doc/ja/invoke.txt with the equivalent explanation in Japanese for the new interactive mode behavior. (doc/ja/invoke.txt: doc/ja/invoke.txtR25-R30)

Release Notes:

  • Added a note in NEWS to highlight the new behavior for determining interactive mode. (NEWS: NEWSR38-R41)
  • Added the corresponding update to NEWS.ja for Japanese users. (NEWS.ja: NEWS.jaR29-R32)

POSIX.1-2024 changed the wording of the condition under which the shell
automatically becomes interactive. There may be some positional
parameters as long as the shell is reading commands from the standard
input and the standard input and standard error are both connected to
a terminal.
@magicant magicant added this to the 2.59 milestone Apr 20, 2025
@magicant magicant self-assigned this Apr 20, 2025
@magicant
magicant merged commit 788ac3a into trunk Apr 20, 2025
@magicant
magicant deleted the auto-interactive branch April 20, 2025 15:03
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.

Enable the interactive mode if the shell is invoked with the -s option and an operand with stdin and stderr connected to a terminal

1 participant