Skip to content

setsid: accept --ctty, --fork and --wait - #675

Open
jayhemnani9910 wants to merge 2 commits into
uutils:mainfrom
jayhemnani9910:setsid-long-options
Open

jayhemnani9910 wants to merge 2 commits into
uutils:mainfrom
jayhemnani9910:setsid-long-options

Conversation

@jayhemnani9910

Copy link
Copy Markdown
Contributor

setsid only takes -c, -f and -w. util-linux also has --ctty, --fork and --wait (setsid(1)):

$ setsid --fork --wait /usr/bin/false; echo $?
util-linux 2.41.3: 1
uutils:            error: unexpected argument '--fork' found ... 1

The three arguments now have their long names. New test long_options (fails on main); the setsid tests pass (12) and clippy is clean. --fork --wait, --wait and --fork give the same exit codes as util-linux.

Copilot AI balanced review requested due to automatic review settings October 23, 2026 06:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

Comment thread tests/by-util/test_setsid.rs Outdated
.succeeds()
.no_output();
// without a terminal --ctty fails, but as an option it is accepted
new_ucmd!()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weak test, could you please use terminal_simulation like unprivileged_user_can_take_new_controlling_tty and check that --wait --ctty succeeds?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 6a075af: long_options_take_new_controlling_tty runs setsid --wait --ctty under terminal_simulation, as unprivileged_user_can_take_new_controlling_tty does, and checks it succeeds and the controlling terminal changes. It fails on main. I dropped the old --ctty check from long_options.

Copilot AI balanced review requested due to automatic review settings October 25, 2026 07:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

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.

3 participants