Add support for syntax highlighting #8733

Open
opened 2026-01-31 01:36:39 +00:00 by claunia · 20 comments
Owner

Originally created by @42wim on GitHub (Jun 1, 2020).

Description of the new feature/enhancement

Add support for syntax highlighting specific words like MobaXterm has:

image

This makes finding errors/issues much easier and it's something that I immediately miss when using terminal :-)

Originally created by @42wim on GitHub (Jun 1, 2020). # Description of the new feature/enhancement <!-- A clear and concise description of what the problem is that the new feature would solve. Describe why and how a user would use this new functionality (if applicable). --> Add support for syntax highlighting specific words like MobaXterm has: ![image](https://user-images.githubusercontent.com/1810977/83451728-c1dfc880-a457-11ea-9e22-1363fc31fbb8.png) This makes finding errors/issues much easier and it's something that I immediately miss when using terminal :-)
Author
Owner

@DHowett commented on GitHub (Jun 2, 2020):

This'll make a nice extension in the future. It's adjacent to search v2, but different enough that it warrants a separate explanation.

@DHowett commented on GitHub (Jun 2, 2020): This'll make a nice extension in the future. It's adjacent to search v2, but different enough that it warrants a separate explanation.
Author
Owner

@DHowett commented on GitHub (Jun 2, 2020):

Link: #4000

@DHowett commented on GitHub (Jun 2, 2020): Link: #4000
Author
Owner

@zhaone commented on GitHub (Feb 25, 2023):

Is there any update about this feature? I still can not find any config that enable custom keywords highlight.

@zhaone commented on GitHub (Feb 25, 2023): Is there any update about this feature? I still can not find any config that enable custom keywords highlight.
Author
Owner

@kolbasky commented on GitHub (Apr 6, 2023):

I can double that. The only reason i still use moba is because of syntax highlight.
In iTerm2 on mac it can be achieved with "highlight trigger", which accepts regex and colors.
Maybe it would be a good start - no built-in syntax highlighting for different languages, but give users means to set up their own regexes.

@kolbasky commented on GitHub (Apr 6, 2023): I can double that. The only reason i still use moba is because of syntax highlight. In iTerm2 on mac it can be achieved with "highlight trigger", which accepts regex and colors. Maybe it would be a good start - no built-in syntax highlighting for different languages, but give users means to set up their own regexes.
Author
Owner

@zadjii-msft commented on GitHub (Apr 6, 2023):

@kolbasky FWIW I'm tracking "do something on a regex" over in #5916. I'm not sure that would scale to the scope of this issue - the OP looks like it'd have a lot of different matches, and terminal-side recoloring is Hard. But it's along the same vein.

@zadjii-msft commented on GitHub (Apr 6, 2023): @kolbasky FWIW I'm tracking "do something on a regex" over in #5916. I'm not sure that would scale to the scope of this issue - the OP looks like it'd have a _lot_ of different matches, and terminal-side recoloring is **H**ard. But it's along the same vein.
Author
Owner

@zhaone commented on GitHub (May 30, 2023):

@kolbasky can't agree more. I'll give up moba if this feature was developed.

@zhaone commented on GitHub (May 30, 2023): > @kolbasky can't agree more. I'll give up moba if this feature was developed.
Author
Owner

@StrangePeanut commented on GitHub (Jul 27, 2023):

Following. Currently using an overpriced paid alternative but would drop it in a heartbeat if this feature were introduced in Windows Terminal.

@StrangePeanut commented on GitHub (Jul 27, 2023): Following. Currently using an overpriced paid alternative but would drop it in a heartbeat if this feature were introduced in Windows Terminal.
Author
Owner

@zadjii-msft commented on GitHub (Jul 27, 2023):

@StrangePeanut So, I've kinda got a spec for "regex matching + colorize the matched text" over in #15700. Would something like:

"triggers":[
    {
        "match": "[Ee][Rr][Rr][Oo][Rr]",
        "action": "experimental.colorSelection",
        "foreground": "#ff0000"
    },
]

work for your use case? (just trying to figure out how exactly you're using the "overpriced alternative" 😉 )

@zadjii-msft commented on GitHub (Jul 27, 2023): @StrangePeanut So, I've kinda got a spec for "regex matching + colorize the matched text" over in #15700. Would something like: ```json "triggers":[ { "match": "[Ee][Rr][Rr][Oo][Rr]", "action": "experimental.colorSelection", "foreground": "#ff0000" }, ] ``` work for your use case? (just trying to figure out how exactly you're using the _"overpriced alternative"_ 😉 )
Author
Owner

@StrangePeanut commented on GitHub (Jul 27, 2023):

@zadjii-msft Oh wow that's brilliant, thanks! This would fully cover my use case actually.

@StrangePeanut commented on GitHub (Jul 27, 2023): @zadjii-msft Oh wow that's brilliant, thanks! This would fully cover my use case actually.
Author
Owner

@MagikEh commented on GitHub (Jul 31, 2023):

This is exactly what I've been hoping to have, an effectively client side grcat, a program that takes stdout, runs it through a regex filter and colourizes output.

@MagikEh commented on GitHub (Jul 31, 2023): This is exactly what I've been hoping to have, an effectively client side [grcat](https://github.com/garabik/grc), a program that takes stdout, runs it through a regex filter and colourizes output.
Author
Owner

@ReK42 commented on GitHub (Jul 31, 2024):

👍 for this feature. There are various tools to do this for individual command output, but nothing I can see that can do it for the entire interactive session without messing up how stdin/out/err and control sequences work.

Perhaps use the TextMate language specification for highlighting rules (*.tmLanguage)? This is widely supported in text/code editors, including VS Code, and has a large library of rules already.

@ReK42 commented on GitHub (Jul 31, 2024): :+1: for this feature. There are various tools to do this for individual command output, but nothing I can see that can do it for the entire interactive session without messing up how stdin/out/err and control sequences work. Perhaps use the TextMate language specification for highlighting rules (*.tmLanguage)? This is widely supported in text/code editors, including VS Code, and has a large library of rules already.
Author
Owner

@hanyce commented on GitHub (Aug 6, 2024):

any update?

@hanyce commented on GitHub (Aug 6, 2024): any update?
Author
Owner

@joryvd commented on GitHub (Dec 8, 2024):

Would also really like this feature!

@joryvd commented on GitHub (Dec 8, 2024): Would also really like this feature!
Author
Owner

@clillies commented on GitHub (Apr 2, 2025):

I would love this feature. Especially when a bit tired, to be able to specify a pattern (see how easy that was to spot), any pattern would do (even though I prefer regexp), and make the line or the match have a certain format.
A bit like Emacs highlight-lines-matching-regexp
or highlight-regexp.

@clillies commented on GitHub (Apr 2, 2025): I would love this feature. Especially when a bit tired, to be able to specify a **pattern** (see how easy that was to spot), any pattern would do (even though I prefer regexp), and make the line or the match have a certain format. _A bit like Emacs `highlight-lines-matching-regexp`_ or `highlight-regexp`.
Author
Owner

@Wimterbourne commented on GitHub (Sep 9, 2025):

I would very much like this feature also.

@Wimterbourne commented on GitHub (Sep 9, 2025): I would very much like this feature also.
Author
Owner

@jonny64 commented on GitHub (Sep 16, 2025):

it seems like no one term app like alacritty wezterm has this feature, except mobaxterm

@jonny64 commented on GitHub (Sep 16, 2025): it seems like no one term app like alacritty wezterm has this feature, except mobaxterm
Author
Owner

@jacob-roldan commented on GitHub (Sep 17, 2025):

it seems like no one term app like alacritty wezterm has this feature, except mobaxterm

In Tabby with plugin highlight, you can have different colors for different words

@jacob-roldan commented on GitHub (Sep 17, 2025): > it seems like no one term app like alacritty wezterm has this feature, except mobaxterm In Tabby with plugin highlight, you can have different colors for different words
Author
Owner

@AutonomousCat commented on GitHub (Nov 5, 2025):

+1

@AutonomousCat commented on GitHub (Nov 5, 2025): +1
Author
Owner

@JoseGonzalez84 commented on GitHub (Nov 11, 2025):

This feature will be very valuable to Windows Terminal users; please consider excluding this topic from the Icebox milestone.

@JoseGonzalez84 commented on GitHub (Nov 11, 2025): This feature will be very valuable to Windows Terminal users; please consider excluding this topic from the Icebox milestone.
Author
Owner

@levontumanyan commented on GitHub (Nov 25, 2025):

this would be awesome, how do we implement this?

@levontumanyan commented on GitHub (Nov 25, 2025): this would be awesome, how do we implement this?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#8733