fish 4.6.0: Shell with better emoji display & Bash pipes

The interactive shell fish 4.6.0 brings improved emoji display, new prompt options, and Bash-compatible pipe syntax.

listen Print view
An emblem with mountains, a river, and a global network symbol on a purple background with stars and a grid.

(Image: heise medien)

3 min. read
Contents

The interactive Unix shell fish can, from version 4.6.0, take prompt information directly from environment variables, display emoji in the terminal more broadly, and accept a pipe notation familiar from Bash with |&. fish is aimed at administrators and developers who prefer an interactive shell with easily readable syntax and many convenience features. Unlike Bash or Zsh, fish prioritize this over strict POSIX compliance.

fish now evaluates three new environment variables: SHELL_PROMPT_PREFIX, SHELL_PROMPT_SUFFIX, and SHELL_WELCOME. The prefix and suffix automatically appear before and after the left prompt, and the welcome variable displays an additional message upon startup. This allows, for example, clearly marking privileged or specially started sessions without having to write custom prompt logic. The developers cite systemd run0 as a typical use case.

Furthermore, fish now treats emoji as two cells wide by default instead of one. This corrects a common source of errors in terminal display, with the shell recently assuming UTF-8 as the default: if the assumed character width does not match the actual display, prompts, indents, and tabular outputs will be misaligned. The change primarily helps users accessing older systems from modern desktops. To counteract misalignments on older terminals, fish_emoji_width can be reset to 1.

From version 4.6.0, fish accepts |& as an alternative notation to &|. Both redirect standard output and standard error jointly into a pipe. A typical example: make |& less sends build outputs and error messages together to the pager. The addition reduces stumbling blocks for users who regularly switch between Bash and fish.

set_color now specifically turns off style attributes such as italics, underline, reverse, and strikethrough – for example, with --italics=off. Also new are the options --foreground and --reset. They make it easier for theme authors and prompt frameworks to precisely control terminal attributes.

Videos by heise

Signals such as SIGWINCH, which the system sends when the window size changes, for example, no longer interrupt builtin outputs. The developers have also fixed a crash when suspending certain pipelines via Ctrl-Z. On macOS, the release eliminates an error that caused slow terminal responses at startup.

Version 4.6.0 also corrects several bugs from releases 4.3 to 4.5: an intermediate artifact during prompt redraw, the ignored option --color= with history, problems in vi mode with dl and dh, and faulty completion for commands starting with -.

The completion pager now aligns descriptions to the left. fish_indent now preserves comments and blank lines directly before a brace block. For developers and distributors: cargo xtask subcommands no longer abort with a panic on test failures. The maintainers point out in the Release Notes that users should obtain the source code via fish-4.6.0.tar.xz – the generic tar.gz archive from GitHub cannot be built correctly.

(fo)

Don't miss any news – follow us on Facebook, LinkedIn or Mastodon.

This article was originally published in German. It was translated with technical assistance and editorially reviewed before publication.