mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
Ensure that UTF-8 works if LANG contains it.
Some people like to have their terminals claim UTF-8 support when their terminals actually are set to another encoding. As nobody appears to understand this, I have made a change to automatically fix the encoding problems if possible. This uses ISO 2022 sequences in order to dynamically change the encoding. Fixes #692. Fixes #895. Fixes possible future issues about this.
This commit is contained in:
parent
602f040940
commit
d61adfbc53
1 changed files with 10 additions and 0 deletions
|
@ -130,3 +130,13 @@ function . --description 'Evaluate contents of file (deprecated, see "source")'
|
|||
source $argv
|
||||
end
|
||||
end
|
||||
|
||||
# Fix lame terminals lying about their encoding (UTF-8 when it's not).
|
||||
function __fish_update_charset --on-variable LANG
|
||||
switch $LANG
|
||||
case \*.UTF-8
|
||||
echo -n \e%G
|
||||
end
|
||||
end
|
||||
|
||||
__fish_update_charset
|
||||
|
|
Loading…
Reference in a new issue