I saw this konsole bug concerning the wcwidth values of U+4DC0..U+4DFF. Testing shows that vte is also affected by the same problem, with the same symptoms. Looking at glibc source for wcwidth data even shows that apart from the block above glibc has a few more cases where their wcwidth differs from the unicode data.
We should consider to use the glibc values here.
It looks like the best I might be able to do, and handle things in the wild already, is to make some sort of equivalence between shell-precmd
and seeing vte.title
and vte.cwd
changed consecutively.
That of course can have false negatives though, but at worst you loose a shell notification, so meh.
Okay, I found the culprit, it's changes to vte.sh
on Fedora.
# Newer bash versions support PROMPT_COMMAND as an array. In this case
# only add the __vte_osc7 function to it, and leave setting the terminal
# title to the outside setup.
# On older bash, we can only overwrite the whole PROMPT_COMMAND, so must
# use the __vte_prompt_command function which also sets the title.
if [[ "$(declare -p PROMPT_COMMAND 2>&1)" =~ "declare -a" ]]; then
PROMPT_COMMAND+=(__vte_osc7) && PS0=$(printf "\033]777;preexec\033\\")
else
PROMPT_COMMAND="__vte_prompt_command" && PS0=$(printf "\033]777;preexec\033\\")
fi
This is causing us to hit the first path, and never emit precmd
.
How lovely to have yet another way to have to handle things.
Perhaps I can track window title as well instead of precmd
to do the tracking.
I don't think so because I'm spawning a shell via host which will pull in my host /etc/profile.d/vte.sh
afaict.
I cannot repo: running vte-2.91 -v
(from the wip/termprops branch), and doing printf '\e]777;precmd\e\\'
therein, I get the expected
Termprop 'vte.ext.fedora.shell.precmd' changed to no-value
output.
The vte.sh
from fedora patch isn't on that branch, so it's expected that precmd
isn't emitted automatically by the shell. Is that the problem here?
Trying compile VTE 0.76.0 but see this build error:
../src/app/app.cc:727:41: error: use of undeclared identifier 'typeof'; did you mean 'typeid'?
727 | *ptr = (typeof *ptr)v;
| ^~~~~~
| typeid
../src/app/app.cc:727:47: error: expected '(' after 'typeid'
727 | *ptr = (typeof *ptr)v;
| ^
| (
This problem error is on Clang 18.1.2. Full build log build.log.gz
Also when tring build with GCC 13.2.1-0.20240309 see almost same problem.
../src/app/app.cc: In lambda function:
DEBUG util.py:448: ../src/app/app.cc:727:41: error: ‘typeof’ was not declared in this scope; did you mean ‘typedef’?
DEBUG util.py:448: 727 | *ptr = (typeof *ptr)v;
DEBUG util.py:448: | ^~~~~~
DEBUG util.py:448: | typedef
DEBUG util.py:448: ../src/app/app.cc:727:53: error: expected ‘;’ before ‘v’
DEBUG util.py:448: 727 | *ptr = (typeof *ptr)v;
DEBUG util.py:448: | ^
Full build log with GCC https://file-store.openmandriva.org/api/v1/file_stores/e37edcc4ea82217b40854474bd8d8e33d59612b7.log?show=true
Worth to add previous stable 0.74.2 compiling fine. Problem is with 0.76.0
Works here with g++ 12.3.1, and fails with clang++ 15.0.7, though with a different error.
Does the build succeed if you patch
-cxx_req_std = 'gnu++20'
+cxx_req_std = 'gnu++23'
in the toplevel meson.build
?
Trying compile VTE 0.76.0 but see this build error:
../src/app/app.cc:727:41: error: use of undeclared identifier 'typeof'; did you mean 'typeid'?
727 | *ptr = (typeof *ptr)v;
| ^~~~~~
| typeid
../src/app/app.cc:727:47: error: expected '(' after 'typeid'
727 | *ptr = (typeof *ptr)v;
| ^
| (
This problem error is on Clang 18.1.2. Full build log build.log.gz
Also when tring build with GCC 13.2.1-0.20240309 see almost same problem.
../src/app/app.cc: In lambda function:
DEBUG util.py:448: ../src/app/app.cc:727:41: error: ‘typeof’ was not declared in this scope; did you mean ‘typedef’?
DEBUG util.py:448: 727 | *ptr = (typeof *ptr)v;
DEBUG util.py:448: | ^~~~~~
DEBUG util.py:448: | typedef
DEBUG util.py:448: ../src/app/app.cc:727:53: error: expected ‘;’ before ‘v’
DEBUG util.py:448: 727 | *ptr = (typeof *ptr)v;
DEBUG util.py:448: | ^
Full build log with GCC https://file-store.openmandriva.org/api/v1/file_stores/e37edcc4ea82217b40854474bd8d8e33d59612b7.log?show=true
Worth to add previous stable 0.74.2 compiling fine. Problem is with 0.76.0
termprop-changed::vte.ext.fedora.shell.precmd
doesn't seem to emit for me (I actually never see it hit in Terminal::urxvt_extension()
for *token
.
But container name/runtime and shell-preexec are definitely working.
Christian Hergert (aa405e4b) at 25 Mar 21:34
terminal: fix UTF-8 bounds check
Christian Hergert (4a79d855) at 25 Mar 21:34
terminal: fix UTF-8 bounds check