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:

Retro Koss CL5i On-Ear Headphones: Style & Sound Unleashed!
Headphones

Retro Koss CL5i On-Ear Headphones: Style & Sound Unleashed!

$14.99
Buy Now
-30% Experience Deep Bass: TuneFlux Wireless Bluetooth Headphones!
Headphones

Experience Deep Bass: TuneFlux Wireless Bluetooth Headphones!

$26.99 Original price was: $26.99.$18.99Current price is: $18.99.
Buy Now
-33% Experience Soundcore A20i: 28H Playtime & AI Call Clarity!
Headphones

Experience Soundcore A20i: 28H Playtime & AI Call Clarity!

$29.99 Original price was: $29.99.$19.99Current price is: $19.99.
Buy Now
Amazon Basics 3-Button USB Wired Mouse: Effortless Control!
Computer & Accessories

Amazon Basics 3-Button USB Wired Mouse: Effortless Control!

$7.13
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

“Mac Vulnerability Under Active Exploitation Gives Attackers Full Control”

Clair Obscur: 2025 Game of the Year Now Just $33

“Investors File Fraud Lawsuit Against Selena Gomez’s Mental Health Startup”

“Private Security Firms Authorised to Target Overseas Cybercriminals”

Pixel 11 Event: Trevor Noah Unveils Google’s Latest Smartphones Live

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 Wellness with IAMJOY Smart Health Wristband – Track & Improve! Boost Wellness with IAMJOY Smart Health Wristband – Track & Improve! $188.22 Original price was: $188.22.$99.99Current price is: $99.99.
  • STREBITO 142-Piece Precision Screwdriver Set: Ultimate Tech Toolkit! STREBITO 142-Piece Precision Screwdriver Set: Ultimate Tech Toolkit! $27.99
  • Wyze Noise Cancelling Headphones: HiFi Sound & Alexa Inside! Wyze Noise Cancelling Headphones: HiFi Sound & Alexa Inside! $89.99 Original price was: $89.99.$75.99Current price is: $75.99.
  • Elevate Gaming: BENGOO G9000 7.1 Headset with LED & Mic! Elevate Gaming: BENGOO G9000 7.1 Headset with LED & Mic! $29.99 Original price was: $29.99.$16.98Current price is: $16.98.
  • Monster Blaster Micro: Clip-On Waterproof Bluetooth Speaker! Monster Blaster Micro: Clip-On Waterproof Bluetooth Speaker! $65.99 Original price was: $65.99.$39.99Current price is: $39.99.

You Might also Like

AI Policies: Lessons from Hank Green’s Controversy

Admin Admin 7 Min Read
Tesla Plans B Solar Factory Investment in Texas
Technology

Tesla Plans $10B Solar Factory Investment in Texas

Admin Admin 3 Min Read
“DEF CON Group Linked to Delta Flight Fake-Hotspot Incident”
Technology

“DEF CON Group Linked to Delta Flight Fake-Hotspot Incident”

Admin Admin 3 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?