Close Menu
    Facebook LinkedIn YouTube WhatsApp X (Twitter) Pinterest
    Trending
    • A New Way to Experience Audiobooks
    • Data says ‘AI kills jobs’ isn’t true – workers at companies not using it are most at risk
    • A Library Dedicated Solely to the Epstein Files Is Opening in New York
    • Ars Asks: Share your shell and show us your tricked-out terminals!
    • Mindtrip’s AI Flight Agent Wants to Solve the Messy Travel Plans Search Engines Can’t
    • Ten Key Enablers for 6G Wireless Communications
    • Why I Don’t Trust LLMs to Decide When the Weather Changed
    • Luxury family tiny house with two bedrooms, luxury bathroom and stocked kitchen
    Facebook LinkedIn WhatsApp
    Times FeaturedTimes Featured
    Wednesday, May 6
    • Home
    • Founders
    • Startups
    • Technology
    • Profiles
    • Entrepreneurs
    • Leaders
    • Students
    • VC Funds
    • More
      • AI
      • Robotics
      • Industries
      • Global
    Times FeaturedTimes Featured
    Home»News»Ars Asks: Share your shell and show us your tricked-out terminals!
    News

    Ars Asks: Share your shell and show us your tricked-out terminals!

    Editor Times FeaturedBy Editor Times FeaturedMay 6, 2026No Comments5 Mins Read
    Facebook Twitter Pinterest Telegram LinkedIn Tumblr WhatsApp Email
    Share
    Facebook Twitter LinkedIn Pinterest Telegram Email WhatsApp Copy Link


    The timer_stop operate additionally has the job of changing the timer right into a human-readable format, and it’s in all probability messier than it must be. I’m no developer, although, so that is what Previous Lee settled on after a couple of hours of looking out via examples.

    Doing it in fish for people like me

    That’s for bash once I’m ssh’d into one among my Linux hosts, however I run fish on MacOS. I’ve a separate fish operate for getting the identical outcomes there, full with gross hacks for turning the measurement into human-readable type. I made this code, and I’m unapologetic. Witness my cobbled-together StackOverflow-sourced kludge.

    operate fish_prompt --description 'Write out the immediate'
        # Save the final standing
        set -l last_status $standing
    
        # Calculate the command length if accessible
        set -l cmd_duration ""
        if set -q CMD_DURATION
            # Convert milliseconds to microseconds for extra exact comparability
            set -l duration_us (math "$CMD_DURATION * 1000")
    
            # Calculate completely different time models
            set -l us (math "$duration_us % 1000")
            set -l ms (math "ground($duration_us / 1000) % 1000")
            set -l s (math "ground($duration_us / 1000000) % 60")
            set -l m (math "ground($duration_us / 60000000) % 60")
            set -l h (math "ground($duration_us / 3600000000)")
    
            # Format length string
            if take a look at $h -gt 0
                set cmd_duration (string be part of '' "(" $h "h" $m "m)")
            else if take a look at $m -gt 0
                set cmd_duration (string be part of '' "(" $m "m" $s "s)")
            else if take a look at $s -ge 10
                set -l fraction (math "ground($ms / 100)")
                set cmd_duration (string be part of '' "(" $s "." $fraction "s)")
            else if take a look at $s -gt 0
                set cmd_duration (string be part of '' "(" $s "." (printf "%03d" $ms) "s)")
            else if take a look at $ms -ge 100
                set cmd_duration (string be part of '' "(" $ms "ms)")
            else if take a look at $ms -gt 0
                set -l fraction (math "ground($us / 100)")
                set cmd_duration (string be part of '' "(" $ms "." $fraction "ms)")
            else
                set cmd_duration (string be part of '' "(" $us "us)")
            finish
        finish
    
        # Outline unicode symbols for standing
        set -l checkmark "✓"
        set -l cross "✗"
    
        # Colours
        set -l regular (set_color regular)
        set -l dark_gray (set_color 555555)
        set -l blue (set_color -o blue)
        set -l crimson (set_color crimson)
        set -l inexperienced (set_color inexperienced)
        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 standing
    
        # Standing indicator with exit standing
        if take a look at $last_status -eq 0
            echo -n -s $inexperienced $checkmark
        else
            echo -n -s $crimson $cross
        finish
    
        # Really echo the length
        echo -n -s $dark_gray " $cmd_duration"
    
        # Do the remainder of the immediate
        echo
        set -l host_color $purple
        echo -n -s $host_color $USER "@" (prompt_hostname) $regular ":" $blue (prompt_pwd) $regular " $ "
    finish

    A splash of colour

    Spending my early life immersed in ANSI BBS graphics has in all probability made me somewhat extra fond of colourful textual content in my terminal than the common frumpy, button-downed admin. Look, I do know some of us really feel that syntax highlighting and colours usually kill comprehension and encourage skimming, however what can I say? I really like them and depend on them. Maybe I skim an excessive amount of, however so be it. You may take my colourful shell instruments from my chilly, useless fingers.

    To that finish, I lean on somewhat program referred to as GRC (for Generic Colorizer) so as to add highlighting and coloration to different instruments. It’s broadly accessible and works with none extra configuration.

    Nothing fallacious with somewhat colour!

    Lee Hutchinson

    Nothing fallacious with somewhat colour!

    Lee Hutchinson


    Image showing the before and after of using ip a with ping

    Nothing fallacious with somewhat colour!

    Lee Hutchinson

    There’s a little bit of aliasing (which I hold in .bash_aliases like a superb citizen) to make colourful output the defaults on some widespread instructions:

        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'

    I’m additionally a giant fan of constructing my numbers human-readable, and the -h swap is due to this fact utilized liberally.

    (Do observe that wrapping instructions like ip in GRC can generally do bizarre issues when you’re piping its output into one thing else. Use warning. Or don’t! It’s your laptop, knock your self out!)

    The terminal itself

    Sharp-eyed readers will observe from the screenshots that I’m utilizing MacOS’s Terminal.app for my terminal program, regardless of there being much better choices. I suppose the excuse I’ve is that I’m comfortable with Terminal.app and nothing has pulled me off of it. I’ve test-driven the standard suspects—Ghostty, Alacritty, the mighty iTerm2 with its superior tmux windowing integration, and even fancy new reinterpretations of the terminal expertise like Warp.



    Source link

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Editor Times Featured
    • Website

    Related Posts

    Arizona Lottery $12.8M winning ticket dispute: Circle K fights deadline as ownership battle intensifies

    May 6, 2026

    Senate to probe sports betting boom and risks to game integrity in May 20 hearing

    May 6, 2026

    Widely used Daemon Tools disk app backdoored in monthlong supply-chain attack

    May 5, 2026

    Why Reddit blocked my daily visit to its mobile website

    May 5, 2026

    Kenosha casino plan advances to final federal review stage

    May 5, 2026

    Apple held exploratory talks with Intel and its executives visited a Samsung plant in Texas to explore producing core chips for its devices in the US (Bloomberg)

    May 5, 2026
    Leave A Reply Cancel Reply

    Editors Picks

    A New Way to Experience Audiobooks

    May 6, 2026

    Data says ‘AI kills jobs’ isn’t true – workers at companies not using it are most at risk

    May 6, 2026

    A Library Dedicated Solely to the Epstein Files Is Opening in New York

    May 6, 2026

    Ars Asks: Share your shell and show us your tricked-out terminals!

    May 6, 2026
    Categories
    • Founders
    • Startups
    • Technology
    • Profiles
    • Entrepreneurs
    • Leaders
    • Students
    • VC Funds
    About Us
    About Us

    Welcome to Times Featured, an AI-driven entrepreneurship growth engine that is transforming the future of work, bridging the digital divide and encouraging younger community inclusion in the 4th Industrial Revolution, and nurturing new market leaders.

    Empowering the growth of profiles, leaders, entrepreneurs businesses, and startups on international landscape.

    Asia-Middle East-Europe-North America-Australia-Africa

    Facebook LinkedIn WhatsApp
    Featured Picks

    The First Person Has Been Convicted Under a New US Anti-Deepfake Law

    April 9, 2026

    Delhi police arrest three and seize cash funds in illegal gambling raid

    January 13, 2026

    Text-to-Speech Generators: A Game-Changer for Audiobooks

    June 4, 2025
    Categories
    • Founders
    • Startups
    • Technology
    • Profiles
    • Entrepreneurs
    • Leaders
    • Students
    • VC Funds
    Copyright © 2024 Timesfeatured.com IP Limited. All Rights.
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
    • About us
    • Contact us

    Type above and press Enter to search. Press Esc to cancel.