mirror of
https://github.com/eRgo35/dots.git
synced 2025-12-17 07:56:11 +01:00
funny fish
This commit is contained in:
9
.config/fish/functions/_pure_string_width.fish
Normal file
9
.config/fish/functions/_pure_string_width.fish
Normal file
@@ -0,0 +1,9 @@
|
||||
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
|
||||
Reference in New Issue
Block a user