Skip to content

Fix bug where newlines are printed to stdout on path warnings#11248

Merged
krobelus merged 1 commit into
fish-shell:masterfrom
metamuffin:bug-stdout-on-path-warn
Mar 9, 2025
Merged

Fix bug where newlines are printed to stdout on path warnings#11248
krobelus merged 1 commit into
fish-shell:masterfrom
metamuffin:bug-stdout-on-path-warn

Conversation

@metamuffin
Copy link
Copy Markdown
Contributor

@metamuffin metamuffin commented Mar 9, 2025

Description

Currently fish prints a newline to stdout in maybe_issue_path_warning. Warnings are printed to stderr, just the newline is printed to stdout. This PR prints the newline to stderr too. This bug changes a program's stdout if such warnings are emitted, e.g. "error: can not save history" on startup if home is not writable.

I found the problem when running non-interactive scripts with homeless users.
image

TODOs:

  • Changes to fish usage are reflected in user documentation/manpages.
  • Tests have been added for regressions fixed
    • Unsure how to test for this. But I can add it if required
  • User-visible changes noted in CHANGELOG.rst
    • Is it a "notable fix"?

@krobelus krobelus merged commit 4227f53 into fish-shell:master Mar 9, 2025
@krobelus krobelus added this to the fish 4.0.1 milestone Mar 9, 2025
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Mar 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants