I’m sure some of you have absolute monstrosities of sigils (I know I do, in my .zshrc alone). Post them without context, and try and guess what other users’s lines are. If you want to provide context or guess, use the markdown editor to spoiler-tag your guesses and explanations!

  • Gamma@programming.devOPM
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago
    Corrections

    First, a look at man termcap:

           ch   Move cursor horizontally only to column %1
           ct   Clear tabs
    

    (j::) actually joins with no seperator. The character following the j is used to capture the separator. Nearly any character or paired bracket can be used, but colons are common. Other ways to write this which might have been more obvious: (j''), (j[]), (j<>). To actually join with colons, something like (j.:.) would have been used.

    Full context

    Zsh agressively sets tabstops to every 8 characters. This is in a function which I trap to the WINCH signal, to set the termstops to 4 using the $termcap sequences rather than the external command tput:

    .on_winch(){
    	# tabs
    	local -a s
    	repeat COLUMNS/$1 s+=(${termcap[RI]/\%p1\%d/$1}$termcap[st])
    
    	# final
    	print -rn $termcap[sc]${termcap[ch]//(\%i|\%p1|\%d)}$termcap[ct]${(j::)s}$termcap[rc]
    }
    .on_winch 4
    trap '.on_winch 4' WINCH