Append a newline to your shell prompt
The default shell prompt (for Ubuntu 20) looks like this:
|
|
The format of the prompt is defined in .bashrc
, as the PS1
variable:
If you add a newline around the end of the PS1
defintion, your shell will start looking like this (after re-running bash
):
|
|
Why do this?
- More screen width for a one-liner. You can write longer commands before you get disrupted by line-wrapping. Especially useful if you’re using Termux.
- Easier to read the prompt. Your eyes naturally capture text above&below the line you’re working on, so you get to see more without shifting attention.
- It’s an extremely simple thing to do. It’s cumbersome and potentially disruptive to install
$your_favourite_shell_theme
every time you touch a remote machine, whereas adding\n
to.bashrc
takes about ten seconds in a text editor.