Breaking
March 22, 2025

Linux Fu: A Warp Speed Prompt Al Williams | usagoldmines.com

If you spend a lot of time at the command line, you probably have either a very basic prompt or a complex, information-dense prompt. If you are in the former camp, or you just want to improve your shell prompt, have a look at Starship. It works on the most common shells on most operating systems, so you can use it everywhere you go, within reason. It has the advantage of being fast and you can also customize it all that you want.

What Does It Look Like?

It is hard to explain exactly what the Starship prompt looks like. First, you can customize it almost infinitely, so there’s that. Second, it adapts depending on where you are. So, for example, in a git-controlled directory, you get info about the git status unless you’ve turned that off. If you are in an ssh session, you’ll see different info than if you are logged in locally.

However, here’s a little animation from their site that will give you an idea of what you might expect:

Installation

The web site says you need a Nerd Font in your terminal. I didn’t remember doing that on purpose, but apparently I had one already.

Next, you just have to install using one of the methods they provide, which depends on your operating system. For Linux, you can run the installer:

curl -sS https://starship.rs/install.sh | sh

Sure, you should download it first and look to make sure it won’t reformat your hard drive or something, but it was fine when we did it.

Finally, you have to run an init command. How you do that depends on your shell and they have plenty of examples. There’s even a way to use it with cmd.exe on Windows!

Customization

The default isn’t bad but, of course, you are going to want to change things. Oddly, the system doesn’t create a default configuration file. It just behaves a certain way if it doesn’t find one. You must make your own ~/.config/starship.toml file. You can change where the file lives using an environment variable, if you prefer, but you still have to create it.

The TOML file format has sections like an INI file. Just be aware that any global options have to come before any section (that is, there’s no [global] tag). If you put things towards the bottom of the file, they won’t seem to work and it is because they have become part of the last tag.

There are a number of modules and each module reads data from a different section. For example, on my desktop I have no need for battery status so:

[battery]
disabled = true

Strings

In the TOML file you can use single or double quotes. You can also triple a quote to make a string break lines (but the line breaks are not part of the string). The single quotes are treated as a literal, while double quotes require escape characters for special things.

You can use variables in strings like $version or $git_branch. You can also place part of a string in brackets and then formating for the string in parenthesis immediately following. For example:

'[off](fg:red bold)'

Finally, you can have a variable print only if it exists:

 '(#$id)'

If $id is empty, this does nothing. Otherwise, it will print the # and the value.

Globals and Modules

You can find all the configuration options — and there are many — in the Starship documentation. Of primary interest is the global format variable. This sets each module that is available. However, you can also use $all to get all the otherwise unspecified modules. By default, the format variable starts with $username $hostname. Suppose you wanted it to be different. You could write:

format='$hostname ! $username $all'

You’ll find many modules that show the programming language used for this directory, version numbers, and cloud information. You can shut things off, change formatting, or rearrange. Some user-submitted customizations are available, too. Can’t find a module to do what you want? No problem.

Super Custom

I wanted to show the status of my watercooler, so I created a custom section in the TOML file:

[custom.temp]
command = 'temp-status|grep temp|cut -d " " -f 7'
when = true
format='$output°'

The command output winds up in, obviously, $output. In this case, I always want the module to output and the format entry prints the output with a degree symbol after it. Easy!

Of Course, There are Always Others

There are other prompt helpers out there, especially if you use zsh (e.g., Oh My Zsh). However, if you aren’t on zsh, your options are more limited. Oh My Posh is another cross-shell entry into the field. Of course, you don’t absolutely need any of these. They work because shells give you variables like PS1 and PROMPT_COMMAND, so you can always roll your own to be as simple or complex as you like. People have been doing their own for a very long time.

If you want to do your own for bash, you can get some help online. Or, you could add help to bash, too.

 

This articles is written by : Nermeen Nabil Khear Abdelmalak

All rights reserved to : USAGOLDMIES . www.usagoldmines.com

You can Enjoy surfing our website categories and read more content in many fields you may like .

Why USAGoldMines ?

USAGoldMines is a comprehensive website offering the latest in financial, crypto, and technical news. With specialized sections for each category, it provides readers with up-to-date market insights, investment trends, and technological advancements, making it a valuable resource for investors and enthusiasts in the fast-paced financial world.

Recent:

Thanks for Hackaday Europe! Elliot Williams | usagoldmines.com

FBI Issues ‘Medusa’ Alert As Hackers Target Critical Infrastructure, Extort Victims for Cash Alex Ri...

The Fastest MS-DOS Gaming PC Ever Maya Posch | usagoldmines.com

Biosynthesis of Polyester Amides in Engineered Escherichia Coli Maya Posch | usagoldmines.com

A Cute Handheld Gaming Device That You Can Build In An Altoids Tin Lewin Day | usagoldmines.com

Producing Syngas From CO2 and Sunlight With Direct Air Capture Maya Posch | usagoldmines.com

21,899 Bank Customers Affected As US Lender Suffers Cybersecurity Breach, Hacker Taps Social Securit...

Moving Software Down to Hardware Bryan Cockfield | usagoldmines.com

Turning a Kombucha Bottle Into a Plasma Tube Lewin Day | usagoldmines.com

Building a Handheld Pong Game Lewin Day | usagoldmines.com

High Frequency Food: Better Cutting With Ultrasonics Lewin Day | usagoldmines.com

Benchtop Haber-Bosch Makes Ammonia at Home Dan Maloney | usagoldmines.com

Hackaday Podcast Episode 313: Capacitor Plague, Wireless Power, and Tiny Everything Jenny List | usa...

This Week in Security: The Github Supply Chain Attack, Ransomware Decryption, and Paragon Jonathan B...

Aluminum Business Cards Make Viable PCB Stencils Lewin Day | usagoldmines.com

Cheap Endoscopic Camera Helps Automate Pressure Advance Calibration Dan Maloney | usagoldmines.com

A Modern Take on the Etch A Sketch Bryan Cockfield | usagoldmines.com

Solar Power, Logically Al Williams | usagoldmines.com

Backyard Rope Tow from Spare Parts Bryan Cockfield | usagoldmines.com

$19,500,000 Payout Incoming After Wells Fargo Sued Over Alleged Secret Recordings of Potential Custo...

Laser Harp Sets the Tone Bryan Cockfield | usagoldmines.com

Three SPI Busses Are One Too Many on This Cheap Yellow Display Jenny List | usagoldmines.com

Chemistry Meets Mechatronics in This Engaging Art Piece Dan Maloney | usagoldmines.com

PiEEG Kit is a Self-Contained Biosignal Labratory Tom Nardi | usagoldmines.com

World’s Smallest Blinky, Now Even Smaller Dan Maloney | usagoldmines.com

Pick Up A Pebble Again Jenny List | usagoldmines.com

Modern Computing’s Roots or The Manchester Baby Heidi Ulrich | usagoldmines.com

This M5Stack Game Is Surprisingly Addictive Jenny List | usagoldmines.com

FLOSS Weekly Episode 825: Open Source CI With Semaphore Jonathan Bennett | usagoldmines.com

From the Ashes: Coal Ash May Offer Rich Source of Rare Earth Elements Dan Maloney | usagoldmines.com

Reviving a Maplin 4600 DIY Synthesizer From the 1970s Donald Papp | usagoldmines.com

So What is a Supercomputer Anyway? Maya Posch | usagoldmines.com

Make Fancy Resin Printer 3D Models FDM-Friendly Donald Papp | usagoldmines.com

“Glasses” That Transcribe Text To Audio Lewin Day | usagoldmines.com

Spy Tech: Build Your Own Laser Eavesdropper Heidi Ulrich | usagoldmines.com

Speeding Up Your Projects With Direct Memory Access Lewin Day | usagoldmines.com

Ultra-Low Power Soil Moisture Sensor Bryan Cockfield | usagoldmines.com

A Foot Pedal To Supplement Your Keyboard Lewin Day | usagoldmines.com

The Capacitor Plague of the Early 2000s Maya Posch | usagoldmines.com

Keebin’ with Kristina: the One with the Cheesy Keyboard Kristina Panos | usagoldmines.com

Simulating Embedded Development To Reduce Iteration Time Lewin Day | usagoldmines.com

Checking In On the ISA Wars and Its Impact on CPU Architectures Maya Posch | usagoldmines.com

Writing a GPS Receiver from Scratch Bryan Cockfield | usagoldmines.com

DIY Your Own Red Light Therapy Gear Lewin Day | usagoldmines.com

Simple Robot Assembled From E-Waste Actually Looks Pretty Cool Lewin Day | usagoldmines.com

Current Mirrors Tame Common Mode Noise Heidi Ulrich | usagoldmines.com

Turning Down the Noise on SMPS Bryan Cockfield | usagoldmines.com

Recreating A Braun Classic With 3D Printing Lewin Day | usagoldmines.com

Repairing a Legendary Elka Synthex Analog Synthesizer Maya Posch | usagoldmines.com

Ask Hackaday: What Would You Do With the World’s Smallest Microcontroller? Dan Maloney | usagoldmine...

Build Your Own Air Mouse, Okay? Lewin Day | usagoldmines.com

Relativity Space Changes Course on Path to Orbit Tom Nardi | usagoldmines.com

3D Printed Brick Layers for Everyone Al Williams | usagoldmines.com

A 6502, In The Shell Jenny List | usagoldmines.com

The Amiga No One Wanted Al Williams | usagoldmines.com

Wire Recording Speaks Again Al Williams | usagoldmines.com

Hackaday Links: March 16, 2025 Dan Maloney | usagoldmines.com

Blue Ghost Watches Lunar Eclipse from the Lunar Surface Maya Posch | usagoldmines.com

Inside a “Budget” Current Probe Al Williams | usagoldmines.com

JPMorgan Chase Tricked Into Signing $175,000,000 Deal to Acquire Sham Company in Alleged Bank Fraud ...

Transmitting Wireless Power Over Longer Distances Maya Posch | usagoldmines.com

A Look at the Panasonic FS-A1FM Al Williams | usagoldmines.com

A Hacker’s Approach to All Things Antenna Heidi Ulrich | usagoldmines.com

Repairing a Kodak Picture Maker Kiosk Al Williams | usagoldmines.com

Building a Fully Automatic Birkeland-Eyde Reactor Maya Posch | usagoldmines.com

Add WebUSB Support To Firefox With a Special USB Device Maya Posch | usagoldmines.com

Billion-Dollar Bank’s Employee Secretly Transfers $123,000 From Customer Accounts to His Associates:...

You Too Can Do the Franck-Hertz Experiment Al Williams | usagoldmines.com

2,300,000 Credit and Debit Cards Leaked on Dark Web As Hackers Infect Millions of Devices, Drain Ban...

Putting Conductive TPU To The Test Heidi Ulrich | usagoldmines.com

JPMorgan Chase, Wells Fargo and Bank of America Refuse To Reimburse Customers After Scammers Attack ...

My Scammer Girlfriend: Baiting a Romance Fraudster Maya Posch | usagoldmines.com

Hackaday Europe 2025: Streaming Live Tom Nardi | usagoldmines.com

Probably The Simplest Sequencing Synth Jenny List | usagoldmines.com

Make Your Cheap Thermal Camera into a Microscope Al Williams | usagoldmines.com

Building a Ten-Hundred Key Computer Word-Giving Thing Dan Maloney | usagoldmines.com

Bank of America Insider Helps Criminals and Illicit Businesses Launder Funds in Massive Global Consp...

C+P: Combining the Usefulness of C with the Excellence of Prolog Maya Posch | usagoldmines.com

Hotel Giant Handing $45,000,000 To Customers After Massive Data Breaches Hit Millions of People Dail...

Pi Hand is a Digital Display of a Different Sort Tom Nardi | usagoldmines.com

Hackaday Podcast Episode 312: Heart Attacks, the Speed of Light, and Self-balancing Al Williams | us...

220,968 Americans Exposed As Major Data Breach Leaks Names, Addresses, Social Security Numbers, Medi...

You Know Pi, But Do You Really Know E? Al Williams | usagoldmines.com

Utah’s FORGE: a Research Laboratory For Enhanced Geothermal Systems Maya Posch | usagoldmines.com

This Week in Security: The X DDoS, The ESP32 Basementdoor, and the camelCase RCE Jonathan Bennett | ...

ClockworkPi Unveils New PicoCalc Handheld Tom Nardi | usagoldmines.com

The Trials and Tribulations of Building a Pasta Display Tom Nardi | usagoldmines.com

The Mysterious and Important Work of Prop Design on Severance Dan Maloney | usagoldmines.com

Tracking Deep-Sky Objects Bryan Cockfield | usagoldmines.com

BritCSS: Write CSS With British English Spellings Maya Posch | usagoldmines.com

Have Li-ion Batteries Gone Too Far? Navarre Bartz | usagoldmines.com

Got Junk? Then Build This Scrappy TEA Laser Dan Maloney | usagoldmines.com

Linux Fu: Use the Source (Command), Luke Al Williams | usagoldmines.com

Hacking a Rotary Phone Al Williams | usagoldmines.com

Hackaday Europe 2025: Speaker Schedule and Official Event Page Tom Nardi | usagoldmines.com

High-Speed Reservoir Computing With Integrated Laser Graded Artificial Neurons Maya Posch | usagoldm...

A Decade Resistance Box From PCBs Jenny List | usagoldmines.com

Meshtastic Adds Wireless Connectivity to Possum Trap Bryan Cockfield | usagoldmines.com

A Fast Rewind to the Era of Tapesponding Heidi Ulrich | usagoldmines.com

EPROM-based Enigma Machine Bryan Cockfield | usagoldmines.com

Leave a Reply