The Linux terminal doesn't have to be “bad”
You've just finished installing your shiny new Linux distribution on your PC. Everything is in its place, the system is responsive, but as soon as you open the terminal you are faced with the same old-fashioned screen: white text on black background, a minimal prompt (often a simple one user@hostname:~$) and the classic command ls which shows files and folders as a flat, monochrome list.
The beauty of Linux, however,, it's that you don't have to keep it that way. The terminal is our home and we can customize it to make it not only more beautiful, but infinitely more productive.
In this article we take a complete journey: we will start from scratch by configuring our local PC and we will get to the advanced management of the remote server via SSH, solving that annoying problem that arises when we use GNU Screen and which risks breaking all our beautiful graphics.
Phase 1: Customize the Home Terminal (It is zero)
There are several ways to change the appearance and functionality of our shell on the local PC. To do it, we will use three modern tools: i Nerd Fonts (for icons), Starship (for an advanced prompt) and Its (the modern substitute for command ls).
1. Install the right Font (The basis of everything)
Standard fonts do not contain graphic folder symbols or solid arrows. If we tried to activate the icons now, we would only see sad empty squares. We need to install a Nerd Font (a modified font that includes thousands of icons).
- Go up nerdfonts.com and download a package of your choice (highly recommended JetBrainsMono the FiraCode).
- Extract the file
.zip. - Select all files
.ttf, right click and select Install (on desktop Linux distributions just open the font file and click on “Install” top right, or copy the files into the folder~/.local/share/fonts/). - Open the settings of your local terminal and select the newly installed font (this is. JetBrainsMono Nerd Font).
2. Install and configure Starship
Instead of going crazy with old, complex strings of code to color the prompt, we use Starship, a universal and lightning-fast prompting engine written in Rust.
Open your PC's terminal and install it with the command:
curl -sS https://starship.rs/install.sh | sh
Now we need to tell the terminal to start it. Open your shell configuration file (usually Bash):
nano ~/.bashrc
Scroll to the bottom of the file and paste this line:
eval "$(starship init bash)"
From this moment, every time you open the terminal, you will have a modern and elegant prompt.
3. Install Eza (The new ls)
Its turns the file list into a colored grid, showing specific icons for each file type (the Python icon for files .py, a sprocket for configurations, etc..).
On Ubuntu/Debian and derivatives you can install it like this:
sudo apt install eza
(If you use other distributions like Fedora or Arch, you can find it directly in the official package managers with dnf install eza the pacman -S eza).
To avoid having to type the entire command every time, Let's create a shortcut (alias). Reopen your file .bashrc:
nano ~/.bashrc
In conclusion, add this line:
alias ls='eza --icons=always --grid'
Save, go out and type source ~/.bashrc to apply the changes. Try typing ls: your local terminal is now a jewel of aesthetics and functionality.
Phase 2: The meeting with the Server (And the SSH issue)
Things get serious when from our newly configured Linux PC we connect via SSH to a remote server or a NAS (maybe based on Linux) to administer it.
Here the terminal is no longer just a place to issue small commands, but it becomes the tool with which we manage long scripts, heavy system updates or backups. And this is where a classic problem arises: what happens if the internet connection drops while the server is executing an important command? Or if we have to turn off the laptop but the server has to keep working for hours?
If we launch the command directly in the standard SSH session, dropping the line or closing the terminal on the PC will brutally truncate the process on the server, with the risk of leaving the work half done or corrupting the system.
Phase 3: GNU Screen comes into play (But the graphics break)
To avoid this disaster, every good sysadmin uses GNU Screen. screen creates a virtual session within the server. You connect via SSH, type screen, run your long command e, even if you close the PC window or the line goes out, the server will continue to work in the background. Just log back in later and type screen -r (reattach) to find everything exactly where you left it.
The graphic drama: As soon as you start screen sul server, you realize that all the restyling was done in Phase 1 (il prompt Starship, the icons of eza, the colors) disappears. In their place the standard characters and a string of empty squares return.
Because it happens? Why screen, for isolation and safety reasons, start a secondary session “clean” and is anchored by default to very old font and color management, which ignores modern variables and the UTF-8 encoding needed to display your Nerd Font icons.
Phase 4: The Ultimate Remote Server Solution
To ensure that the server maintains the modern graphics of Starship and Eza even when we work protected inside screen, we need to connect via SSH, become users root (sudo -i) and configure two specific files directly on the server.
1. Configure the .bashrc of the Server
We repeat the installation of Starship and Eza on the server (using the commands seen in the Phase 1). Next we open the file .bashrc in the root of the sul server:
nano /root/.bashrc
At the bottom of the file we have to force the hand of eza. By default, a terminal is visible “isolated” come screen, disable the icons. We force him to use them all the time, also locking the system language in UTF-8 mode:
# Forza la codifica moderna per i caratteri speciali e las icone
export LANG=it_IT.UTF-8
export LC_ALL=it_IT.UTF-8
export EZA_ICONS_AUTO=always
# Attiva il prompt Starship sul server
eval "$(starship init bash)"
# Alias per eza con icone e colori forzati
alias ls='eza --icons=always --grid --color=always'
Save and exit.
2. Teaching manners to Screen (.screenrc)
This is the key step. We need to create the screen configuration file on the server to force it to support modernity:
nano /root/.screenrc
Let's paste these basic directives:
# Il trucco magico: il trattino "-" forza screen a leggere il .bashrc
shell -$SHELL
# Abilita i 256 colori per il prompt Starship
term screen-256color
# Attiva l'UTF-8 strutturale per il transito corretto delle icone
defutf8 on
utf8 on on
Save and exit (Ctrl+O, Invio, Ctrl+X).
The real secret lies in that tiny dash - in front of $SHELL. Dice a screen: “When you open a session, pretend that the user is logging in again from scratch”. This single character forces the program to reread the .bashrc, instantly inheriting Starship, aliases and colored icons.
Conclusions
Thanks to this combined strategy, we got the best of both worlds. On your local PC you will have a modern environment, organized and aesthetically pleasing. When you connect to your remote server, you can launch commands in complete safety using screen to protect them from line drops, without giving up the visual comfort of the icons eza and the clarity of your personalized prompt.
Safe travels and have fun in your new bombproof terminal!


0 Comments