yash-rs icon indicating copy to clipboard operation
yash-rs copied to clipboard

Implementing POSIX.1-2024

Open magicant opened this issue 1 year ago • 0 comments
trafficstars

This issue tracks the tasks involved in implementing the requirements for the shell as defined by The Open Group Base Specifications Issue 8.

  • [x] #424
  • [x] #425
  • [x] #426
  • [x] ;& in case command #430
  • [x] #432
  • [x] #533
  • [x] #437 #438 #440
  • [x] New cd built-in semantics
    • Update the exit status of cd where the new PWD value cannot be determined (with and without -e) #447
    • Reject an empty operand in the cd built-in c9d352145b3b4bf7cd620f59588fafb7c14b01da
  • [x] Update the exit status of getopts on error 79aa9388d4f1a4c949d1a62fbd13b6504c407ad5
  • [x] #449
    • trap (without options or operands) should show signals ignored by inheritance in exec
    • trap -p (without operands) should show all signals
  • [x] #459
  • [x] New read built-in semantics (except byte-wise field splitting)
    • Add the -d option to the read built-in #468
    • The read built-in should treat quotes and escapes as specified in POSIX.1-2024 #467
    • Return from the read built-in different exit statuses depending on the result #466
  • [ ] #477
    • Report immediately on suspension of a foreground job
    • Save the terminal state on suspension of a foreground job and restore when resuming
    • Treat a job suspended when any of its component processes is suspended
    • Treat successive synchronous and-or lists as a single foreground job
    • Discard remaining part of the current list when a foreground process is suspended
    • Allow job control without a controlling terminal
      • Avoid allocating a controlling terminal if the shell does not already have one
    • Use SIGTTIN to suspend the shell when starting job control in the background
    • Reset the shell’s process group ID to match the process ID when starting job control
  • [x] Accept -- separator in the exec built-in 21b20aa701aeedcd79abd4f1d865fb16c2eae9e2
  • [x] Reject if a redirection operand expands to more than one field in an interactive shell *
    • Yash-rs does not expand redirection operands regardless of whether it is interactive
  • [x] Abort the current line and continue the next when an interactive shell encounters a shell error that would exit a non-interactive shell
  • [x] Exclude . and .. from pathname expansion results 5863fe2f104cdb249989886d8da3e9eaa0597036
  • [x] Change false, pwd, and true to substitutive built-ins 85f006e85e8a8b1480b4e57cf36c7c3552e810ca
  • [x] Enable the interactive mode if the shell is invoked with the -s option and an operand with stdin and stderr connected to a terminal 69594a2eb34b05a8ea98894a520edb2472f5e65a
  • [x] #504
  • [x] ~~Reject making LINENO, OLDPWD, OPTARG, OPTIND, and PWD readonly *~~
  • [ ] Document POSIX non-conformance of brace expansion
  • [x] Return exit status 128 on unrecoverable read error a54b44ce352ce4079e4a62e042cd4612aeb6f85d
  • [x] Report the process (group) ID when an interactive shell starts a background job ba4150e9e7259cd6e82209f9a4593d37b1846ecf
  • [x] #491
  • [x] #503
  • [x] #500
  • [x] Keep the tilde expansion result with an empty HOME from empty field removal 93aa4b167b2da5dbd94d7e75f378ba8f45341358
  • [x] ~~Reconsider the semantics of the -h and -o nolog options and update documentation~~
  • [x] Reconsider when alias substitution should be performed in command substitutions of the form $(...)
  • [x] ~~Import only variables that have a valid name from the environment~~
  • [ ] Allow any non-null bytes (possibly not valid characters) in environment variable values
  • [ ] Allow any non-null bytes (possibly not valid characters) in parameter values
  • [ ] Change result types of expansions from character strings to bytes
  • [ ] Reimplement field splitting in terms of bytes
  • [ ] Revise field splitting in the read built-in to match the new field splitting semantics
  • [ ] Sort byte-by-byte if results of pathname expansion collate equal
  • [ ] Set the exit status of suspended jobs to $? only in interactive job-controlling shells

Items marked with an asterisk are behaviors that are newly allowed (but not required) by POSIX.1-2024.

The following are requirements that were not added in POSIX.1-2024, but have existed since earlier versions of POSIX.

  • [x] (Fixed in 7ac4921c27dc71b557fb4a3ba6b58875ace6fc52) https://github.com/magicant/yash-rs/blob/69594a2eb34b05a8ea98894a520edb2472f5e65a/yash-cli/tests/scripted_test/quote-p.sh#L529-L530

magicant avatar Nov 06 '24 09:11 magicant