terminal icon indicating copy to clipboard operation
terminal copied to clipboard

Add support for syntax highlighting

Open 42wim opened this issue 5 years ago • 14 comments

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 :-)

42wim avatar Jun 01 '20 20:06 42wim

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 avatar Jun 02 '20 01:06 DHowett

Link: #4000

DHowett avatar Jun 02 '20 01:06 DHowett

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

zhaone avatar Feb 25 '23 02:02 zhaone

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 avatar Apr 06 '23 10:04 kolbasky

@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 avatar Apr 06 '23 13:04 zadjii-msft

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

zhaone avatar May 30 '23 02:05 zhaone

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

StrangePeanut avatar Jul 27 '23 04:07 StrangePeanut

@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 avatar Jul 27 '23 12:07 zadjii-msft

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

StrangePeanut avatar Jul 27 '23 21:07 StrangePeanut

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 avatar Jul 31 '23 16:07 MagikEh

:+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.

ReK42 avatar Jul 31 '24 19:07 ReK42

any update?

hanyce avatar Aug 06 '24 01:08 hanyce

Would also really like this feature!

joryvd avatar Dec 08 '24 15:12 joryvd

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 avatar Apr 02 '25 12:04 clillies

I would very much like this feature also.

Wimterbourne avatar Sep 09 '25 12:09 Wimterbourne

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

jonny64 avatar Sep 16 '25 18:09 jonny64

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 avatar Sep 17 '25 07:09 jacob-roldan

+1

AutonomousCat avatar Nov 05 '25 06:11 AutonomousCat

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

JoseGonzalez84 avatar Nov 11 '25 13:11 JoseGonzalez84