Terminal prompt syntax

Hi, first of all, this is my first post in the forum so I’m sorry if I’m missing something. If that’s the case, I will gladly change it. Also, I did search for this topic here in the forum and in the subreddit, if this is a duplicate then sorry for writing this and please link me to the original one.

Use case or problem

I use Obsidian every day for writing my homework. I always need to document what commands did I use and how, but I decided that instead of copying screen captures I would rather write them in code blocks so I can later copy that text too. And not only the used command, but the whole terminal instead. Here’s an example:

The thing is, it would be great is there was a way of having syntax highlighting so it is clear what’s going on, the same way we have it in our terminal emulators. I know customization of terminal emulators is always different but the typical colours or bold text for the user and the current working directory, for example, would be great. Using “bash”/“shell” for the code block doesn’t solve what I mean, as you can see.

Proposed solution

Adding basic syntax highlighting for common terminals (cmd, powershell, linux/unix…) which at least makes easy telling appart between user, current working directory, command and output.

Current workaround (optional)

I don’t have one right now but if someone is facing the same issue as me and has any idea, I’m all ears.

2 Likes