{"id":627147,"date":"2026-05-06T16:21:11","date_gmt":"2026-05-06T16:21:11","guid":{"rendered":"https:\/\/www.newsbeep.com\/us\/627147\/"},"modified":"2026-05-06T16:21:11","modified_gmt":"2026-05-06T16:21:11","slug":"ars-asks-share-your-shell-and-show-us-your-tricked-out-terminals","status":"publish","type":"post","link":"https:\/\/www.newsbeep.com\/us\/627147\/","title":{"rendered":"Ars Asks: Share your shell and show us your tricked-out terminals!"},"content":{"rendered":"<p>The timer_stop function also has the job of converting the timer into a human-readable format, and it\u2019s probably messier than it needs to be. I\u2019m no developer, though, so this is what Past Lee settled on after a few hours of searching through examples.<\/p>\n<p>Doing it in fish for folks like me<\/p>\n<p>That\u2019s for bash when I\u2019m ssh\u2019d into one of my Linux hosts, but I run fish on MacOS. I have a separate fish function for getting the same results there, complete with gross hacks for turning the measurement into human-readable form. I made this code, and I am unapologetic. Witness my cobbled-together StackOverflow-sourced kludge.<\/p>\n<p>function fish_prompt &#8211;description &#8216;Write out the prompt&#8217;&#13;<br \/>\n    # Save the last status&#13;<br \/>\n    set -l last_status $status&#13;<br \/>\n&#13;<br \/>\n    # Calculate the command duration if available&#13;<br \/>\n    set -l cmd_duration &#8220;&#8221;&#13;<br \/>\n    if set -q CMD_DURATION&#13;<br \/>\n        # Convert milliseconds to microseconds for more precise comparison&#13;<br \/>\n        set -l duration_us (math &#8220;$CMD_DURATION * 1000&#8221;)&#13;<br \/>\n&#13;<br \/>\n        # Calculate different time units&#13;<br \/>\n        set -l us (math &#8220;$duration_us % 1000&#8221;)&#13;<br \/>\n        set -l ms (math &#8220;floor($duration_us \/ 1000) % 1000&#8221;)&#13;<br \/>\n        set -l s (math &#8220;floor($duration_us \/ 1000000) % 60&#8221;)&#13;<br \/>\n        set -l m (math &#8220;floor($duration_us \/ 60000000) % 60&#8221;)&#13;<br \/>\n        set -l h (math &#8220;floor($duration_us \/ 3600000000)&#8221;)&#13;<br \/>\n&#13;<br \/>\n        # Format duration string&#13;<br \/>\n        if test $h -gt 0&#13;<br \/>\n            set cmd_duration (string join &#8221; &#8220;(&#8221; $h &#8220;h&#8221; $m &#8220;m)&#8221;)&#13;<br \/>\n        else if test $m -gt 0&#13;<br \/>\n            set cmd_duration (string join &#8221; &#8220;(&#8221; $m &#8220;m&#8221; $s &#8220;s)&#8221;)&#13;<br \/>\n        else if test $s -ge 10&#13;<br \/>\n            set -l fraction (math &#8220;floor($ms \/ 100)&#8221;)&#13;<br \/>\n            set cmd_duration (string join &#8221; &#8220;(&#8221; $s &#8220;.&#8221; $fraction &#8220;s)&#8221;)&#13;<br \/>\n        else if test $s -gt 0&#13;<br \/>\n            set cmd_duration (string join &#8221; &#8220;(&#8221; $s &#8220;.&#8221; (printf &#8220;%03d&#8221; $ms) &#8220;s)&#8221;)&#13;<br \/>\n        else if test $ms -ge 100&#13;<br \/>\n            set cmd_duration (string join &#8221; &#8220;(&#8221; $ms &#8220;ms)&#8221;)&#13;<br \/>\n        else if test $ms -gt 0&#13;<br \/>\n            set -l fraction (math &#8220;floor($us \/ 100)&#8221;)&#13;<br \/>\n            set cmd_duration (string join &#8221; &#8220;(&#8221; $ms &#8220;.&#8221; $fraction &#8220;ms)&#8221;)&#13;<br \/>\n        else&#13;<br \/>\n            set cmd_duration (string join &#8221; &#8220;(&#8221; $us &#8220;us)&#8221;)&#13;<br \/>\n        end&#13;<br \/>\n    end&#13;<br \/>\n&#13;<br \/>\n    # Define unicode symbols for status&#13;<br \/>\n    set -l checkmark &#8220;\u2713&#8221;&#13;<br \/>\n    set -l cross &#8220;\u2717&#8221;&#13;<br \/>\n&#13;<br \/>\n    # Colors&#13;<br \/>\n    set -l normal (set_color normal)&#13;<br \/>\n    set -l dark_gray (set_color 555555)&#13;<br \/>\n    set -l blue (set_color -o blue)&#13;<br \/>\n    set -l red (set_color red)&#13;<br \/>\n    set -l green (set_color green)&#13;<br \/>\n    set -l purple (set_color -o purple)&#13;<br \/>\n&#13;<br \/>\n    # First line&#13;<br \/>\n    echo # New line&#13;<br \/>\n    echo -n -s $dark_gray &#8220;[&#8220;(date +%T)&#8221;] $last_status &#8221; # Time in brackets and exit status&#13;<br \/>\n&#13;<br \/>\n    # Status indicator with exit status&#13;<br \/>\n    if test $last_status -eq 0&#13;<br \/>\n        echo -n -s $green $checkmark&#13;<br \/>\n    else&#13;<br \/>\n        echo -n -s $red $cross&#13;<br \/>\n    end&#13;<br \/>\n&#13;<br \/>\n    # Actually echo the duration&#13;<br \/>\n    echo -n -s $dark_gray &#8221; $cmd_duration&#8221;&#13;<br \/>\n&#13;<br \/>\n    # Do the rest of the prompt&#13;<br \/>\n    echo&#13;<br \/>\n    set -l host_color $purple&#13;<br \/>\n    echo -n -s $host_color $USER &#8220;@&#8221; (prompt_hostname) $normal &#8220;:&#8221; $blue (prompt_pwd) $normal &#8221; \\$ &#8220;&#13;<br \/>\nend<br \/>\nA splash of color<\/p>\n<p>Spending my formative years immersed in ANSI BBS graphics has probably made me a little more fond of colorful text in my terminal than the average frumpy, button-downed admin. Look, I know some folks feel that syntax highlighting and colors in general <a href=\"https:\/\/www.linusakesson.net\/programming\/syntaxhighlighting\/\" rel=\"nofollow noopener\" target=\"_blank\">kill comprehension and encourage skimming<\/a>, but what can I say? I love them and rely on them. Perhaps I skim too much, but so be it. You can take my colorful shell tools from my cold, dead hands.<\/p>\n<p>To that end, I lean on a little program called GRC (for <a href=\"https:\/\/github.com\/garabik\/grc\" rel=\"nofollow noopener\" target=\"_blank\">Generic Colorizer<\/a>) to add highlighting and coloration to other tools. It\u2019s broadly available and works without any additional configuration.<\/p>\n<p>  <a data-pswp-width=\"2474\" data-pswp-height=\"1534\" data-cropped=\"true\" href=\"https:\/\/cdn.arstechnica.net\/wp-content\/uploads\/2026\/04\/shelltrix_grc1.png\" target=\"_blank\" class=\"cursor-zoom-in\" data-pswp- rel=\"nofollow noopener\"><br \/>\n    <img decoding=\"async\" width=\"1024\" height=\"635\" src=\"https:\/\/www.newsbeep.com\/us\/wp-content\/uploads\/2026\/05\/shelltrix_grc1-1024x635.png\" class=\"ars-gallery-image\" alt=\"Image showing the before and after of using GRC with ping\" loading=\"lazy\" aria-labelledby=\"caption-2151914\"  \/><br \/>\n  <\/a><\/p>\n<p>      Nothing wrong with a little color!<\/p>\n<p>\n                      Lee Hutchinson\n                  <\/p>\n<p>\n              Nothing wrong with a little color!<\/p>\n<p>                      Lee Hutchinson<\/p>\n<p>  <a data-pswp-width=\"2474\" data-pswp-height=\"1534\" data-cropped=\"true\" href=\"https:\/\/cdn.arstechnica.net\/wp-content\/uploads\/2026\/04\/shelltrix_grc2.png\" target=\"_blank\" class=\"cursor-zoom-in\" data-pswp- rel=\"nofollow noopener\"><br \/>\n    <img decoding=\"async\" width=\"1024\" height=\"635\" src=\"https:\/\/www.newsbeep.com\/us\/wp-content\/uploads\/2026\/05\/shelltrix_grc2-1024x635.png\" class=\"ars-gallery-image\" alt=\"Image showing the before and after of using ip a with ping\" loading=\"lazy\" aria-labelledby=\"caption-2151915\"  \/><br \/>\n  <\/a><\/p>\n<p>\n              Nothing wrong with a little color!<\/p>\n<p>                      Lee Hutchinson<\/p>\n<p>There\u2019s a bit of aliasing (which I keep in .bash_aliases like a good citizen) to make colorful output the defaults on some common commands:<\/p>\n<p>    alias ls=&#8221;ls &#8211;color=auto&#8221;&#13;<br \/>\n    alias ll=&#8221;ls -AlFh &#8211;group-directories-first&#8221;&#13;<br \/>\n    alias df=&#8221;grc df -h&#8221;&#13;<br \/>\n    alias du=&#8217;grc du -h&#8217;&#13;<br \/>\n    alias free=&#8221;grc free -h&#8221;&#13;<br \/>\n    alias ping=&#8217;grc ping&#8217;&#13;<br \/>\n    alias traceroute=&#8221;grc traceroute&#8221;&#13;<br \/>\n    alias ip=&#8217;grc ip&#8217;<\/p>\n<p>I\u2019m also a big fan of making my numbers human-readable, and the -h switch is therefore applied liberally.<\/p>\n<p>(Do note that wrapping commands like ip in GRC can sometimes do weird things if you\u2019re piping its output into something else. Use caution. Or don\u2019t! It\u2019s your computer, knock yourself out!)<\/p>\n<p>The terminal itself<\/p>\n<p>Sharp-eyed readers will note from the screenshots that I\u2019m using MacOS\u2019s Terminal.app for my terminal program, despite there being far better options. I suppose the excuse I have is that I\u2019m comfy with Terminal.app and nothing has pulled me off of it. I\u2019ve test-driven the usual suspects\u2014<a href=\"https:\/\/ghostty.org\/\" rel=\"nofollow noopener\" target=\"_blank\">Ghostty<\/a>, <a href=\"https:\/\/alacritty.org\/\" rel=\"nofollow noopener\" target=\"_blank\">Alacritty<\/a>, the mighty <a href=\"https:\/\/iterm2.com\/index.html\" rel=\"nofollow noopener\" target=\"_blank\">iTerm2<\/a> with its awesome <a href=\"https:\/\/iterm2.com\/documentation-tmux-integration.html\" rel=\"nofollow noopener\" target=\"_blank\">tmux windowing integration<\/a>, and even fancy new reinterpretations of the terminal experience like <a href=\"https:\/\/www.warp.dev\/terminal\" rel=\"nofollow noopener\" target=\"_blank\">Warp<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"The timer_stop function also has the job of converting the timer into a human-readable format, and it\u2019s probably&hellip;\n","protected":false},"author":2,"featured_media":627148,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31],"tags":[74],"class_list":["post-627147","post","type-post","status-publish","format-standard","has-post-thumbnail","category-technology","tag-technology"],"_links":{"self":[{"href":"https:\/\/www.newsbeep.com\/us\/wp-json\/wp\/v2\/posts\/627147","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.newsbeep.com\/us\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.newsbeep.com\/us\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.newsbeep.com\/us\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.newsbeep.com\/us\/wp-json\/wp\/v2\/comments?post=627147"}],"version-history":[{"count":0,"href":"https:\/\/www.newsbeep.com\/us\/wp-json\/wp\/v2\/posts\/627147\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.newsbeep.com\/us\/wp-json\/wp\/v2\/media\/627148"}],"wp:attachment":[{"href":"https:\/\/www.newsbeep.com\/us\/wp-json\/wp\/v2\/media?parent=627147"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.newsbeep.com\/us\/wp-json\/wp\/v2\/categories?post=627147"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.newsbeep.com\/us\/wp-json\/wp\/v2\/tags?post=627147"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}