function _pure_string_width \
    --description 'returns raw string length, i.e. ignore ANSI-color' \
    --argument-names prompt

    set --local empty ''
    set --local raw_prompt (string replace --all --regex '\e\[[^m]*m' $empty $prompt)

    string length $raw_prompt
end

function _pure_string_width \
    --description 'returns raw string length, i.e. ignore ANSI-color' \
    --argument-names prompt

    set --local empty ''
    set --local raw_prompt (string replace --all --regex '\e\[[^m]*m' $empty $prompt)

    string length -- $raw_prompt
end

Handle virtualenvs that look like flags
Handle virtualenvs that look like flags
rafaelrinaldi/pure