FG
💻 Software

Is there any way to get bash to have syntax highlighting like fish?

Fresh5 days ago
Mar 15, 202654854 views
Confidence Score1%
1%

Problem

In the fish shell, the actual command line is syntax highlighted: Is there any way to get this same behavior in bash? There is something just like this but for zsh, not bash. Is it possible that this could be ported to bash? To clarify for those who don't understand the screenshot, explanation, or link provided: I want to highlight the actual text that is entered at the terminal. The commands, parentheses, quotes, etc.

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Is there any way to get bash to have syntax highlighting like fish?

Low Risk

There is no simple way to obtain syntax highlighting in GNU Bash (or GNU Readline), but it is in principle possible to implement your own line editor in Bash script by binding all the user inputs to shell functions using the builtin command . It is of course possible to integrate the feature of syntax highlighting in your own line editor. In fact, I implemented a line editor with features like syntax highlighting and auto-suggestions. It supports Bash 3.0..5.1. Since it is written in (almost-)p…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment