54155: specify $HOST in OSC7 working directory report

This commit is contained in:
Johannes Altmanninger
2026-01-09 12:24:39 +01:00
committed by Oliver Kiddle
parent 6c67981033
commit b0ad7ab750
2 changed files with 10 additions and 2 deletions

View File

@@ -1,5 +1,8 @@
2026-04-05 Oliver Kiddle <opk@zsh.org>
* Johannes Altmanninger: 54155: Src/Zle/termquery.c:
specify $HOST in OSC7 working directory report
* Johannes Altmanninger: 54154: Src/Zle/termquery.c:
extract function for URL-encoding and writing to TTY

View File

@@ -777,11 +777,16 @@ write_urlencoded(const char *path_components)
void
notify_pwd(void)
{
const char *hostnam;
if (!extension_enabled("integration", "pwd", 11, 1))
return;
/* only "localhost" seems to be much use here as the host */
write_loop(SHTTY, "\033]7;file://localhost", 20);
if ((hostnam = getsparam("HOST")) == NULL || strchr(hostnam, '/') != NULL)
return;
write_loop(SHTTY, "\033]7;file://", 11);
write_urlencoded(hostnam);
write_urlencoded(pwd);
write_loop(SHTTY, "\033\\", 2);
}