By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
The Tech DiffThe Tech DiffThe Tech Diff
  • Home
  • Shop
  • Computers
  • Phones
  • Technology
  • Wearables
Reading: “Showcase Your Shell: Share Your Custom Terminal Innovations!”
Share
Font ResizerAa
The Tech DiffThe Tech Diff
Font ResizerAa
  • Computers
  • Phones
  • Technology
  • Wearables
Search
  • Home
  • Shop
  • Computers
  • Phones
  • Technology
  • Wearables
Follow US
  • Shop
  • About
  • Contact
  • Terms & Conditions
  • Privacy Policy
© Copyright 2022. All Rights Reserved By The Tech Diff.
The Tech Diff > Blog > Technology > “Showcase Your Shell: Share Your Custom Terminal Innovations!”
Technology

“Showcase Your Shell: Share Your Custom Terminal Innovations!”

Admin
Last updated: May 11, 2026 12:56 am
Admin
Share
“Showcase Your Shell: Share Your Custom Terminal Innovations!”
SHARE

The timer_stop function is essential not only for stopping timers but also for converting the elapsed time into a human-readable format. However, navigating its complexities can be challenging for non-developers. This functionality, as cobbled together by “Past Lee,” demonstrates the ingenuity involved in overcoming programming hurdles.

Contents
Doing it in Fish for Folks Like MeA Splash of ColorThe Terminal Itself

Doing it in Fish for Folks Like Me

While the initial examples may cater to Bash users logged into their Linux hosts, users on MacOS typically prefer the Fish shell. Lee Hutchinson has created a specific Fish function that yields similar results, employing crafty hacks to present time measurements legibly. The following function showcases this creative effort:

-7% Unleash Sound: SAMSUNG Type-C Earphones in Sleek Black!
Headphones

Unleash Sound: SAMSUNG Type-C Earphones in Sleek Black!

$15.97 Original price was: $15.97.$14.84Current price is: $14.84.
Buy Now
Ultimate Sound: Focal Utopia High-Fidelity Over-Ear Headphones
Headphones

Ultimate Sound: Focal Utopia High-Fidelity Over-Ear Headphones

$4,999.00
Buy Now
-30% Maximize Productivity: 13-in-1 Anker USB-C Docking Station!
Computer & Accessories

Maximize Productivity: 13-in-1 Anker USB-C Docking Station!

$199.99 Original price was: $199.99.$139.99Current price is: $139.99.
Buy Now
Apricot Ergonomic Mouse Pad & Wrist Rest: Comfort & Style!
Computer & Accessories

Apricot Ergonomic Mouse Pad & Wrist Rest: Comfort & Style!

$19.99
Buy Now
function fish_prompt --description 'Write out the prompt'
    # Save the last status
    set -l last_status $status

    # Calculate the command duration if available
    set -l cmd_duration ""
    if set -q CMD_DURATION
        # Convert milliseconds to microseconds for more precise comparison
        set -l duration_us (math "$CMD_DURATION * 1000")

        # Calculate different time units
        set -l us (math "$duration_us % 1000")
        set -l ms (math "floor($duration_us / 1000) % 1000")
        set -l s (math "floor($duration_us / 1000000) % 60")
        set -l m (math "floor($duration_us / 60000000) % 60")
        set -l h (math "floor($duration_us / 3600000000)")

        # Format duration string
        if test $h -gt 0
            set cmd_duration (string join '' "(" $h "h" $m "m)")
        else if test $m -gt 0
            set cmd_duration (string join '' "(" $m "m" $s "s)")
        else if test $s -ge 10
            set -l fraction (math "floor($ms / 100)")
            set cmd_duration (string join '' "(" $s "." $fraction "s)")
        else if test $s -gt 0
            set cmd_duration (string join '' "(" $s "." (printf "%03d" $ms) "s)")
        else if test $ms -ge 100
            set cmd_duration (string join '' "(" $ms "ms)")
        else if test $ms -gt 0
            set -l fraction (math "floor($us / 100)")
            set cmd_duration (string join '' "(" $ms "." $fraction "ms)")
        else
            set cmd_duration (string join '' "(" $us "us)")
        end
    end

    # Define unicode symbols for status
    set -l checkmark "✓"
    set -l cross "✗"

    # Colors
    set -l normal (set_color normal)
    set -l dark_gray (set_color 555555)
    set -l blue (set_color -o blue)
    set -l red (set_color red)
    set -l green (set_color green)
    set -l purple (set_color -o purple)

    # First line
    echo # New line
    echo -n -s $dark_gray "["(date +%T)"] $last_status " # Time in brackets and exit status

    # Status indicator with exit status
    if test $last_status -eq 0
        echo -n -s $green $checkmark
    else
        echo -n -s $red $cross
    end

    # Actually echo the duration
    echo -n -s $dark_gray " $cmd_duration"

    # Do the rest of the prompt
    echo
    set -l host_color $purple
    echo -n -s $host_color $USER "@" (prompt_hostname) $normal ":" $blue (prompt_pwd) $normal " $ "
end

A Splash of Color

Having spent formative years captivated by ANSI BBS graphics, Lee has developed a fondness for colorful terminal text, distinguishing him from conventional system administrators. While some believe that syntax highlighting undermines comprehension, Lee argues otherwise, insisting that he benefits from a vibrant terminal environment.

To enhance the color experience, he leverages a program called GRC (Generic Colorizer), which effortlessly adds color to terminal outputs without requiring extensive configurations. The transformation from standard text to a riot of colors can be visually striking:

Nothing wrong with a little color!
Lee Hutchinson

Image showing the before and after of using ip a with ping
Nothing wrong with a little color!
Lee Hutchinson

To integrate colorful output into his workflow, Lee implements aliasing in his .bash_aliases file:

alias ls="ls --color=auto"
alias ll="ls -AlFh --group-directories-first"
alias df="grc df -h"
alias du='grc du -h'
alias free="grc free -h"
alias ping='grc ping'
alias traceroute="grc traceroute"
alias ip='grc ip'

By applying the -h switch, he ensures human readability across various outputs. However, he wisely advises caution when using GRC with certain commands that may produce confusing results when piped.

The Terminal Itself

Readers may also notice that Lee prefers MacOS’s Terminal.app despite the myriad of alternatives. His comfort with this application continues to outweigh the potential benefits of exploring contenders like Ghostty, Alacritty, and iTerm2. This highlights a common trend among users who appreciate familiarity over exploration, even in a rapidly evolving tech landscape.

You can read more about Lee’s terminal setups and colorful experiences here.

Image Credit: arstechnica.com

You Might Also Like

“TMD’s Keyless Bike Lock: A $280 Answer to a $60 Dilemma”

“College Value Confirmed: Data Supports Education in Tough Job Markets”

“Fittest Founder Battles Cancer Using AI Technology”

Notion Terminates Skiff-Influenced Email App Amid AI Adoption Surge

“Top MacBook Deals Before Imminent Price Hike”

Share This Article
Facebook Twitter Copy Link Print
Previous Article “Trending Phones: Week 19’s Top 10 Must-Have Devices” “Trending Phones: Week 19’s Top 10 Must-Have Devices”
Next Article “Website Security Essentials: Protecting Your Site with BigScoots”
Leave a comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Product categories

  • Computer & Accessories
  • Headphones
  • Laptops
  • Phones
  • Wearables

Trending Products

  • Boost Your Workspace: NiHome Iridescent Acrylic Monitor Stand Boost Your Workspace: NiHome Iridescent Acrylic Monitor Stand $25.99 Original price was: $25.99.$20.79Current price is: $20.79.
  • ESR iPhone 17 Pro Max Case: Stylish & Strong with MagSafe! ESR iPhone 17 Pro Max Case: Stylish & Strong with MagSafe! $33.99
  • EdgeRest PostureUp L-Shaped Desk: Ultimate Wrist Comfort! EdgeRest PostureUp L-Shaped Desk: Ultimate Wrist Comfort! $59.99 Original price was: $59.99.$47.99Current price is: $47.99.
  • HP 15.6” Touch Laptop: Power Meets Style in Silver! HP 15.6” Touch Laptop: Power Meets Style in Silver! $659.99 Original price was: $659.99.$389.90Current price is: $389.90.
  • PANPEO 7-Port USB 3.0 Hub: Ultimate Data Hub Splitter! PANPEO 7-Port USB 3.0 Hub: Ultimate Data Hub Splitter! $15.99 Original price was: $15.99.$7.99Current price is: $7.99.

You Might also Like

“Americans Oppose AI Data Centers Amid Rising Concerns”
Technology

“Americans Oppose AI Data Centers Amid Rising Concerns”

Admin Admin 6 Min Read
White House Urges OpenAI to Delay New Model Due to Safety Risks
Technology

White House Urges OpenAI to Delay New Model Due to Safety Risks

Admin Admin 3 Min Read
“Cybercrime Assembly Line Disrupted by International Operation’s One-Two Punch”
Technology

“Cybercrime Assembly Line Disrupted by International Operation’s One-Two Punch”

Admin Admin 4 Min Read

About Us

At The Tech Diff, we believe technology is more than just innovation—it’s a lifestyle that shapes the way we work, connect, and explore the world. Our mission is to keep readers informed, inspired, and ahead of the curve with fresh updates, expert insights, and meaningful stories from across the digital landscape.

Useful Link

  • Shop
  • About
  • Contact
  • Terms & Conditions
  • Privacy Policy

Categories

  • Computers
  • Phones
  • Technology
  • Wearables

Sign Up for Our Newsletter

Subscribe to our newsletter to get our newest articles instantly!

We don’t spam! Read our privacy policy for more info.

Check your inbox or spam folder to confirm your subscription.

The Tech DiffThe Tech Diff
Follow US
© Copyright 2022. All Rights Reserved By The Tech Diff.
Welcome Back!

Sign in to your account

Lost your password?