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:

-20% Retro Koss Porta Pro On-Ear Headphones: Durable & Chic!
Headphones

Retro Koss Porta Pro On-Ear Headphones: Durable & Chic!

$49.99 Original price was: $49.99.$39.99Current price is: $39.99.
Buy Now
Unlock Sound: Audio-Technica ATH-M30x Studio Headphones
Headphones

Unlock Sound: Audio-Technica ATH-M30x Studio Headphones

$79.00
Buy Now
-62% Unlock Fast Charging: Syntech USB C to USB Adapter Pack of 2
Computer & Accessories

Unlock Fast Charging: Syntech USB C to USB Adapter Pack of 2

$12.99 Original price was: $12.99.$5.00Current price is: $5.00.
Buy Now
Marshall Major V: Ultimate Black Wireless Bluetooth Headphones
Headphones

Marshall Major V: Ultimate Black Wireless Bluetooth Headphones

$99.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

“Future Offices: Embrace the Quiet Revolution in Workspaces”

“Writers Abandon Substack Tax Amid Growing Financial Concerns”

Glycol Vapors: A Potential Solution to Respiratory Pandemics

Parker Fintech Startup Declares Bankruptcy Amid Financial Struggles

Cyberattack Disrupts Canvas Learning Platform During Finals Chaos

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

  • Ultimate Kensington USB-A Hi-Fi Headphones for Everyone! Ultimate Kensington USB-A Hi-Fi Headphones for Everyone! $21.99 Original price was: $21.99.$17.99Current price is: $17.99.
  • Top Fitness Trackers for Women: Smart Watch with Calls & More! Top Fitness Trackers for Women: Smart Watch with Calls & More! $79.99 Original price was: $79.99.$49.99Current price is: $49.99.
  • Secure Your Drive: WeatherTech WindshieldFone Holder! Secure Your Drive: WeatherTech WindshieldFone Holder! $39.99 Original price was: $39.99.$25.45Current price is: $25.45.
  • Unleash Power: HP Victus 15.6″ Gaming Laptop – 144Hz FHD! Unleash Power: HP Victus 15.6" Gaming Laptop - 144Hz FHD! $25.00
  • Revolutionary Laptop Harness: Hands-Free Walking Desk! Revolutionary Laptop Harness: Hands-Free Walking Desk! $46.99

You Might also Like

“Asus Launches Compelling Secondary Touchscreen to Rival Elgato”
Technology

“Asus Launches Compelling Secondary Touchscreen to Rival Elgato”

Admin Admin 3 Min Read
“Doctors: The Challenge of Getting a Callback Explained”
Technology

“Doctors: The Challenge of Getting a Callback Explained”

Admin Admin 6 Min Read
Mozilla: Mythos Uncovers 271 Vulnerabilities with Minimal False Positives
Technology

Mozilla: Mythos Uncovers 271 Vulnerabilities with Minimal False Positives

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?