A celebration of the tweaks and customizations that make life easier at the CLI.
See full article...
See full article...
Inconsolata's a great font. That's what I use too, even though a friend once texted me, verbatim, "We need to get you a better terminal font lol." Ouch. I still don't know why it's bad.
No it isn't, I set it up. I actually forget how now...That’s not standard behavior. The FreeBSD standard tcshrc has some custom parameters to set this, but I’ve not found that behavior standard in any Linux distro I’ve tried.
Strong disagree. How the terminal looks alters how I feel about it. It may not be rational but it's real.Personally I think all the geeking out about fonts and themes and whatever is just a distraction.
Even if it were just a distraction, where's the harm?Somewhat understandable and maybe fun for a while, but still.
(And shout out to Jim!)
No, not really. I played around with the exposure settings in my camera when I took this pic to avoid the "screen tearing" effect that usually happens when photographing CRT monitors, which makes it look a lot more intense than it does in person. I find the amber-on-black display very easy on the eyes!
wl-copy and wl-paste are my friends here. Muscle-memoried C-d (typing an end-of-file) kills the tab/window, which is nice for quickly removing a potentially bloated/frustrating workflow.wl-copy and wl-paste, and Data.Ratio (infinite precision rationals) loaded. Infinite precision rationals are a must-have for a good calculator app. Typing end-of-file kills the GHCi process, but not Gnome Console, which is good for preventing muscle memory from wiping useful work.emacsclient. Syntax highlighting is disabled, and there is golden-ratio paging, but it is mostly vanilla Emacs with an interface that is more responsive than the default gtk. I call it kittEYmacs. It is very nice to be able to quickly open a view to a file I am editing on another workspace.<-> and <|>, so those are disabled in Kitty. It specializes in math-symbol unicode coverage, but even when not taking advantage of that, it strikes a very pleasing synergy between ergonomics and aesthetics. For my keyboard layout, I use programmer dvorak; I don't know that it's any faster than qwerty, but it feels like I am typing in cursive.DEVICE=C:\WINDOWS\SMARTDRV.EXE /DOUBLE_BUFFER
DEVICE=C:\DOS\HIMEM.SYS /TESTMEM:OFF /VERBOSE
DEVICE=C:\DOS\EMM386.EXE NOEM
BUFFERS=15,0
FILES=30
DOS=UMB
LASTDRIVE=Z
FCBS=4,0
DOS=HIGH
DEVICE=C:\DOS\CDROM.SYS /D:MSCD001 /DMA
DEVICE=C:\DOS\SETVER.EXE
DEVICE=C:\DOS\ANSI.SYS /X
DEVICEHIGH /L:2,4560 =C:\WINDOWS\IFSHELP.SYS
SHELL=C:\COMMAND.COM /E:512 /P
STACKS=9,256
@ECHO OFF
LH /L:0,1,45472 /S C:\WINDOWS\SMARTDRV.EXE
LH /L:1,28288 C:\WINDOWS\MSCDEX.EXE /S /D:MSCD001 /L:D /E
LH /L:1,14880 C:\UTIL\ANARKEY.COM
C:\UTIL\DOSIDLE\DOSIDLE.EXE
SET BLASTER=A200 I5 D1 H5 P330 T6
SET DIRCMD=/A
SET MIDI=SYNTH:1 MAP:3
SET PATH=C:\WINDOWS;C\NET;C:\DOS
SET PROMPT=$e[37;44m$e[1;50H $d $T$h$h$h$h$h$h$e[uR3[37;40m$p$g
SET SOUND=C:\SB16
SET TEMP=C:\TEMP
SET WINPMT=$P»
C:\SB16\DIAGNOSE.EXE /S
C:\SB16\MIXERSET.EXE /P /Q
C:\NET\NWLINK.EXE
C:\WINDOWS\NET.EXE start
CLS
VER /R
C:\DOS\MEM.EXE /A
The color spectrum of direct amber is very different from RGB-simulated amber.That makes sense. The picture looks like its shining bright mustard yellow in someone's face. My eyes itch from thinking of that experience.
(Note: I have some color blindness issues hence my color description.)
bpp if you don't want the interactive windowcd myp from anywhere to go straight there. if you have multiple myproject directories scattered about, you can do things like cd pro co myp to specify one.<snip>
Clean Desktop:
![]()
<snip>
The ANARKEY.COM program file listed in Line 4 of AUTOEXEC.BAT is to run Moderne Software's AnarKey keyboard handler, which I prefer over Microsoft's DOSKEY.COM.
If there's any interest, I'd be happy to add some comments explaining how they work in further detail.
oh great. thanks for the head's up. need to find a way to fix this. anybody recommend a good way to include images in a post? I'm new here
The editor has an insert images options you can drag the file to (if you have local copies).oh great. thanks for the head's up. need to find a way to fix this. anybody recommend a good way to include images in a post? I'm new here
I do something similar, but not quite as fancy or compact:I like to use my prompt to very clearly remind me at all times (1) which user I'm working as, (2) on which machine, and (3) in which directory. This helps me avoid doing anything stupid. But also, I want to do this minimalistically, so that my prompt is not cluttered by any unnecessary default info. To that end, I use the following in my .zshrc file (replacingMYLITERALUSERNAMEwith my literal user name):
Bash:# Custom prompt. PROMPT="" # If sudo-ing or whatever, show the current user name in red. [[ "$USER" != 'MYLITERALUSERNAME' ]] && PROMPT="${PROMPT}%F{1}%n%f" # If not on local machine (ssh or whatever), show machine name in blue. if [[ -z "$TERM_PROGRAM" ]]; then # Separate user name from machine name using `@` [[ -n "$PROMPT" ]] && PROMPT="${PROMPT}%F{7}@%f" PROMPT="${PROMPT}%F{4}%m%f" fi # If we have anything in the prompt already, separate from dir name using `:` [[ -n "$PROMPT" ]] && PROMPT="${PROMPT}%F{7}:%f" # Directory name in yellow. export PROMPT="${PROMPT}%F{11}%1~%f %F{7}%#%f "
View attachment 134466
- The current working directory is always shown in yellow. When I'm in my home directory on my local machine, the prompt is just a
~. Otherwise, it shows me the base name of the current working directory.- When I ssh to another machine (which has the same content in its ~/.zshrc file), the host name is prepended to the prompt in blue.
- Finally, when I use
sudo suto work as another user (e.g. root), the user name is prepended to the prompt in red.
By using these conditional checks, I can have a prompt that only shows me the user and/or host info when they aren't their default values. I like my minimalism, so it makes me happy. But moreover, this means that when I am working on another machine or as another user, it is very obvious.
Testing against$TERM_PROGRAMis a nice little hack that is specific to the macOS Terminal.app. It's conveniently only set in the initial shell environment and not any nested shells, so it makes a good proxy for checking whether I'mssh-ed into another machine and/or usingsudo. If you use another terminal, you can probably find some similar test to run in its place.
cd down and then pressing Tab auto-completes to cd Downloads/. Typing pm and then Tab will list your options (pman pmset), whereas typing pms and then Tab will auto-complete to pmset. It occasionally barfs, but it's been pretty consistent overall, so I haven't taken the effort to figure out why it barfs. alias lls="ls -lhAFwGeOT@"
##### Default Prompt Settings
setopt prompt_subst #apparently necessary for the prompt to display colors
PROMPT=$'\n''%U%D{%a %b %e, %G %l:%M:%S %p}%u%D{%t}%F{blue}%m%f : %F{white}%n%f'$'\n''%~'$'\n''%% '
##### ZSH case-insensitive autocompletion
autoload -Uz compinit && compinit
# case insensitive path-completion
zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*'
The editor has an insert images options you can drag the file to (if you have local copies)
‘90s me would have been absolutely blown away by the timeline that Apple was going to switch to x86 chips, replace MacOS with a fully POSIX-compliant UNIX implementation with a functional UI on top of it (best of both worlds), then much later produce their own line of industry-leading custom silicon, and not only maintain but gain relevance over the decades.Speaking of the 90’s, imagine an alternate universe where we had the same article but it was about what customizations you use for a (modern) Enlightenment window manager.
Desktop UI’s were so dope back then. Unstable as hell, also.
90’s me would be very disappointed if I showed him my boring MacOS and Terminal setup.
@CrunchyWizard, I believe the version in the article is dependent on some functionality not present in your version of bash. However, the older version I posted back on pg1 should work for you! Pasting in spoiler tags below:I love the idea of the .bashrc code you published - and the article as a whole, but even with the fixes to the function timer_now_us from otila, my bash on Red Hat Enterprise Linux v9.7 (GNU bash, version 5.1.8(1)-release (x86_64-redhat-linux-gnu)) consistently throws a 'bad substitution' error and the elapsed time is never correct:
root@mymachinename:~ # sleep 5
-bash: ${ timer_now_us; timer_started_at_us=$REPLY; timer_command_active=1; }: bad substitution
${ timer_now_us; timer_started_at_us=$REPLY; timer_command_active=1; }
[12:01:27] 0 ✓ (0us)
root@mymachinename:~ #
I'm guessing the bash on Macs is slightly different, but my bash script-fu is weak in this instance. Anyone get this working on RHEL?
color_prompt=yes
if [ "$color_prompt" = yes ]; then
function timer_now {
date +%s%N
}
function timer_start {
timer_start=${timer_start:-$(timer_now)}
}
function timer_stop {
local delta_us=$((($(timer_now) - $timer_start) / 1000))
local us=$((delta_us % 1000))
local ms=$(((delta_us / 1000) % 1000))
local s=$(((delta_us / 1000000) % 60))
local m=$(((delta_us / 60000000) % 60))
local h=$((delta_us / 3600000000))
# Goal: always show around 3 digits of accuracy
if ((h > 0)); then timer_show=${h}h${m}m
elif ((m > 0)); then timer_show=${m}m${s}s
elif ((s >= 10)); then timer_show=${s}.$((ms / 100))s
elif ((s > 0)); then timer_show=${s}.$(printf %03d $ms)s
elif ((ms >= 100)); then timer_show=${ms}ms
elif ((ms > 0)); then timer_show=${ms}.$((us / 100))ms
else timer_show=${us}us
fi
unset timer_start
}
#Prompt and prompt colors
function set_prompt {
Last_Command=$?
FancyX='\342\234\227'
Checkmark='\342\234\223'
export PS1="\n$WHITE[\t] "
if [[ $Last_Command == 0 ]]; then
PS1+="\$? $GREEN$Checkmark "
else
PS1+="\$? $RED$FancyX "
fi
timer_stop
PS1+="$WHITE($timer_show)"
PS1+="\n\[$HOSTCOLOR\]\u@\h\[\033[00m\]:\[\033[1;38;5;027m\]\w\[\033[00m\] \\$ "
}
trap 'timer_start' DEBUG
PROMPT_COMMAND='set_prompt'
fi
Uh, the world is far from perfect, but I assure you the latest Claude Code and Codex can do this for you in a couple hours if not several minutes.[...] In a perfect world, I'd know enough coding to reimplement maxdir for *nix and have the free time to do it. Neither are currently true.
@CrunchyWizard, I believe the version in the article is dependent on some functionality not present in your version of bash. However, the older version I posted back on pg1 should work for you! Pasting in spoiler tags below:
I cannot seem to find information on this software tool. What does it do exactly?
Anarkey is an intelligent command-line editor for DOS. With Anarkey,
complete input lines can be entered with two or three keystrokes. Anarkey
is intelligent because there is no need to tell it what you want to enter on
the command line; simply press the <Tab> key and Anarkey figures out what
you want and does it for you.
I see you fixed it already. I like to open an incognito window when I'm testing stuff that's uploaded to an authenticated service. I've done the same thing before. ;-)oh great. thanks for the head's up. need to find a way to fix this. anybody recommend a good way to include images in a post? I'm new here
NOTE: Hard for me to debug this since I can see the images on my end, not sure what's going on