Skip to content

Instantly share code, notes, and snippets.

@theodric
Created July 17, 2025 21:49
Show Gist options
  • Select an option

  • Save theodric/b066271a35161a0b0b6425e8b7c83faa to your computer and use it in GitHub Desktop.

Select an option

Save theodric/b066271a35161a0b0b6425e8b7c83faa to your computer and use it in GitHub Desktop.

Revisions

  1. theodric created this gist Jul 17, 2025.
    15 changes: 15 additions & 0 deletions hot-pink-cursor-bashrc
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    # set cursor color to bright pink in terminals that support OSC 12
    set_cursor_color() {
    # only do this if we're in an interactive tty and not a dumb term
    [[ $- == *i* && $TERM != "dumb" ]] || return
    # OSC 12 escape
    printf '\e]12;#ff00ff\a'
    }

    # detect if we're inside tmux
    if [[ -n $TMUX ]]; then
    # pass through tmux by wrapping in DCS passthrough
    printf '\ePtmux;\e\e]12;#ff00ff\a\e\\'
    else
    set_cursor_color
    fi