Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Swap variable overrides and time in not statement#10890

Closed
krobelus wants to merge 1 commit into
fish-shell:masterfish-shell/fish-shell:masterfrom
krobelus:not-time-fixkrobelus/fish-shell:not-time-fixCopy head branch name to clipboard
Closed

Swap variable overrides and time in not statement#10890
krobelus wants to merge 1 commit into
fish-shell:masterfish-shell/fish-shell:masterfrom
krobelus:not-time-fixkrobelus/fish-shell:not-time-fixCopy head branch name to clipboard

Conversation

@krobelus

@krobelus krobelus commented Dec 8, 2024

Copy link
Copy Markdown
Contributor

This is allowed

time a=b echo 123

but -- due to an oversight in 3de9503 (Make "time" a job prefix,
2019-12-21) -- this is not allowed:

not time a=b echo 123

Instead, this one one works:

not a=b time echo 123

which is weird because without the "not" this would run "/bin/time".

Swap the order for consistency.

This is allowed

	time a=b echo 123

but -- due to an oversight in 3de9503 (Make "time" a job prefix,
2019-12-21) -- this is not allowed:

	not time a=b echo 123

Instead, this one one works:

	not a=b time echo 123

which is weird because without the "not" this would run "/bin/time".

It seems wrong that "not" is not like the others. Swap the order
for consistency.

@faho faho left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@faho faho added this to the fish 4.0 milestone Dec 8, 2024
@krobelus krobelus closed this in 0275c5e Dec 16, 2024
faho pushed a commit to faho/fish-shell that referenced this pull request Dec 26, 2024
This is allowed

	time a=b echo 123

but -- due to an oversight in 3de9503 (Make "time" a job prefix,
2019-12-21) -- this is not allowed:

	not time a=b echo 123

Instead, this one one works:

	not a=b time echo 123

which is weird because without the "not" this would run "/bin/time".

It seems wrong that "not" is not like the others. Swap the order
for consistency.

Note that unlike "not", "time" currently needs to come before variable
assignments, so "a=b time true" is disallowed. This matches zsh. POSIX
shells call "/bin/time" here. Since it's ambiguous, erroring out seems
fine. It's weird that we're inconsistent with not here but I guess
"command not" is not expected to have subtly different behavior.

Closes fish-shell#10890
@krobelus
krobelus deleted the not-time-fix branch February 8, 2025 16:10
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Feb 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.