Already discussed in another issue: https://gitlab.com/gnachman/iterm2/issues/4083
But it seems more like a problem from fish.
Steps to reproduce:
- iTerm2 Preferences > Profiles > General > Working Directory: Reuse previous session's directory
- In config.fish, export LANG="en_US.UTF-8"
cd /path/to/Äpfel; and echo $PWD outputs /path/to/Äpfel
- Switch to a new tab by pressing command-T
- In the new tab,
echo $PWD, gets /path/to/A�pfel
pwd outputs: /path/to/Äpfel (normal)
I suspect this is related to Unicode Normalization Form Decomposition (NFD). And here are some JavaScript for comparison:
$ encodeURI('Äpfel'.normalize('NFD'))
"A%CC%88pfel"
$ decodeURI(encodeURI('Äpfel'.normalize('NFD')))
"Äpfel"
$ unescape(encodeURI('Äpfel'.normalize('NFD')))
"A�pfel"
and two fish commands to illustrate the mechanism of unescape above:
$ printf '\xcc\x88'
̈
$ printf '\u00cc\u0088'
�