mirror of
https://git.code.sf.net/p/zsh/code
synced 2026-04-18 06:53:35 -04:00
54154: extract function for URL-encoding and writing to TTY
This commit is contained in:
committed by
Oliver Kiddle
parent
c8923e69da
commit
6c67981033
@@ -1,5 +1,8 @@
|
||||
2026-04-05 Oliver Kiddle <opk@zsh.org>
|
||||
|
||||
* Johannes Altmanninger: 54154: Src/Zle/termquery.c:
|
||||
extract function for URL-encoding and writing to TTY
|
||||
|
||||
* 54276: Completion/Unix/Command/_zfs: fix to add full list
|
||||
of compression algorithms as completion matches
|
||||
|
||||
|
||||
@@ -765,20 +765,24 @@ mark_output(int start)
|
||||
(start ? sizeof(START) : sizeof(END)) - 1);
|
||||
}
|
||||
|
||||
static void
|
||||
write_urlencoded(const char *path_components)
|
||||
{
|
||||
size_t enc_len;
|
||||
const char *enc = url_encode(path_components, &enc_len);
|
||||
write_loop(SHTTY, enc, enc_len);
|
||||
}
|
||||
|
||||
/**/
|
||||
void
|
||||
notify_pwd(void)
|
||||
{
|
||||
char *url;
|
||||
size_t ulen;
|
||||
|
||||
if (!extension_enabled("integration", "pwd", 11, 1))
|
||||
return;
|
||||
|
||||
url = url_encode(pwd, &ulen);
|
||||
/* only "localhost" seems to be much use here as the host */
|
||||
write_loop(SHTTY, "\033]7;file://localhost", 20);
|
||||
write_loop(SHTTY, url, ulen);
|
||||
write_urlencoded(pwd);
|
||||
write_loop(SHTTY, "\033\\", 2);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user