DeepSeek: Termius terminal prompt highlight

DeepSeek neutral 2 чанков ~2 мин чтения
# Termius terminal prompt highlight<br> Platform: deepseek<br> Model: deepseek-reasoner<br> Date: 2026-03-25T22:52:56.799000+08:00<br> Messages: 2<br> Words: 460<br> <br> ## User<br> https://termius.com/ как мне в терминале сделать так чтобы всегда подсвечивалось root@<br> <br> ## Reasoning (CoT)<br> Hmm, the user is asking how to configure their terminal in Termius to always highlight or color the "root@" part of the prompt. They provided the Termius website link, but that page is just the marketing homepage and doesn't contain technical documentation about customization.<br> <br> I need to answer based on general knowledge about Termius and shell prompt customization. The key point is that Termius itself doesn't have a setting for this—it's about configuring the shell prompt (PS1) on the remote server. I should explain how to check the current prompt, then provide a clear example of how to add color to the "root@" part, with separate instructions for bash and zsh since those are common shells.<br> <br> I'll structure the answer to be practical: explain that it's a shell configuration, show a PS1 example with color codes, and give steps to make it permanent. I'll also mention that Termius respects the prompt as-is, so any changes on the server will reflect. The response should be concise but complete, avoiding any markdown in the thinking itself.<br> <br> ## Assistant<br> To make `root@` (or any part of your prompt) always highlighted in Termius, you need to customize the **shell prompt** on the remote machine, because Termius itself does not control the prompt’s appearance—it only displays what the remote shell sends.<br> <br> Here’s how to do it for **bash** or **zsh**, the most common shells.<br> <br> ### 1. Locate your shell configuration file<br> - **bash**: `~/.bashrc` (or `~/.bash_profile` on some systems)<br> - **zsh**: `~/.zshrc`<br> <br> ### 2. Add a colored prompt<br> Add or modify the `PS1` variable to include color codes. For example, to make **root@** appear in **red** (and keep the rest normal):<br> <br> ```bash<br> PS1='\[\e[31m\]root@\[\e[0m\]\h:\w\$ '<br> ```<br> <br> If you are not logged in as `root`, but want to highlight the **username@** part dynamically:<br> <br> ```bash<br> PS1='\[\e[31m\]\u@\[\e[0m\]\h:\w\$ '<br> ```<br> <br> - `\u` – current username <br> - `\h` – hostname <br> - `\w` – current working directory <br> - `\[\e[31m\]` – red color <br> - `\[\e[0m\]` – reset color<br> <br> For **zsh**, the syntax is slightly different (no `\[` `\]` around color codes):<br> <br> ```zsh<br> PS1=$'%F{red}%n@%f%m:%~$ '<br> ```<br> <br> - `%F{red}` – red foreground <br> - `%f` – reset color <br> - `%n` – username <br> - `%m` – hostname <br> - `%~` – current directory<br> <br> ### 3. Apply changes<br> After editing the file, reload it:<br> ```bash<br> source ~/.bashrc # for bash<br> source ~/.zshrc # for zsh<br> ```<br> <br> Now, every time you connect via Termius, the prompt will appear with the highlighted part.<br> <br> ### Note<br> - If you use a **non‑root user**, the same method works—just change the colors or the part you want to highlight.<br> - For **advanced highlighting** (e.g., change color if user is root), you can add conditional logic inside `PS1`. Let me know if you need an example.<br>