command line – Why does a cURL request return a percent sign (%) with every request in ZSH? – Stack Overflow
Posted by jpluimers on 2025/07/31
I try to stay on the default shells of environments as much as possible, especially as that makes life easier when needing to work on an non-customised system.
Apple switched back from an ancient latest GPLv2 version 3.2 of bash (they regard newer GPLv3 as toxic to their revenue stream¹), introduced MIT-license based zsh and introduced a bash nag screen a few years ago forcing users to switch. Suppressing that message reliably is trickier than you might think².
After so many years of bash, I still stumble over things that zsh does differently: [Wayback/Archive] command line – Why does a cURL request return a percent sign (%) with every request in ZSH? – Stack Overflow (thanks [Wayback/Archive] Travis and [Wayback/Archive] zaTricky) is a “feature” with a simple workaround for cURL:
This is a zsh feature that prints a percent-and-newline after a command completes if that command does not already include a newline at the end of its output. If zsh did not do this, you would either not ever notice the fact that the command didn’t print a newline – or you’d see zsh’s command prompt not start on the margin and think it was a bug in zsh.
…
$ curl http://api.macvendors.com/0015c7 Cisco Systems, Inc% $ curl -w '\n' http://api.macvendors.com/0015c7 Cisco Systems, Inc…
Since the above example now writes a redirect messages (good bye HTTP, welcome HTTPS), and I very much dislike short command-line parameters, here is version with the long form of the [Wayback/Archive] curl -w or --write-out parameter :
% curl https://api.macvendors.com/0015c7 Cisco Systems, Inc%% curl --write-out '\n' https://api.macvendors.com/0015c7 Cisco Systems, Inc
For more on migrating to zsh on MacOS, see:
- [Wayback/Archive] Moving to zsh – Scripting OS X
- [Wayback/Archive] Moving to zsh, part 2: Configuration Files – Scripting OS X
- [Wayback/Archive] Moving to zsh, part 3: Shell Options – Scripting OS X
- [Wayback/Archive] Moving to zsh, part 4: Aliases and Functions – Scripting OS X
- [Wayback/Archive] Moving to zsh, part 5: Completions – Scripting OS X
- [Wayback/Archive] Moving to zsh, part 6 – Customizing the zsh Prompt – Scripting OS X
- [Wayback/Archive] Moving to zsh – part 7: Miscellanea – Scripting OS X
- [Wayback/Archive] Moving to zsh, part 8 – Scripting zsh – Scripting OS X
--jeroen
¹ see for instance:
- [Wayback/Archive] Why did apple switch to zsh? Is it someho… – Apple Community
- [Wayback/Archive] Why does macOS Catalina use Zsh instead of Bash? Licensing
² see for instance:
- [Wayback/Archive] terminal – Suppressing “The default interactive shell is now zsh” message in macOS Catalina – Ask Different (thanks [Wayback/Archive] Gasol Wu, [Wayback/Archive] Chris Wolf, [Wayback/Archive] nverkland and [Wayback/Archive] mmmmmm)
- [Wayback/Archive] Use zsh as the default shell on your Mac – Apple Support
- [Wayback/Archive] Apple open source: Source Browser – bash 123.40.1 (which somewhere after May 2024 vanished from the Apple Open Source servers)
Installing bash from homebrew effectively gets rid of the warning as well on my system. It is easy to do:
brew install bash[Wayback/Archive] bash — Homebrew Formulae
- [Wayback/Archive] homebrew-core/Formula/b/bash.rb at 0287aecc795cbc18563928185a62fa65aab6b99b · Homebrew/homebrew-core · GitHub
- [Wayback/Archive] raw.githubusercontent.com/Homebrew/homebrew-core/0287aecc795cbc18563928185a62fa65aab6b99b/Formula/b/bash.rb
[Wayback/Archive] Bash – GNU Project – Free Software Foundation






Leave a comment