diff options
| -rw-r--r-- | README.md | 6 | ||||
| -rw-r--r-- | vterm-module.c | 6 |
2 files changed, 6 insertions, 6 deletions
@@ -103,7 +103,7 @@ For `zsh` put this in your `.zshrc`: ```zsh function chpwd() { - print -Pn "\e]51;$(pwd)\e\\"; + print -Pn "\e]51;A$(pwd)\e\\"; } ``` @@ -113,7 +113,7 @@ command (please als have a look the answers [here](https://unix.stackexchange.co ```bash cd() { builtin cd "$@" || return - [ "$OLDPWD" = "$PWD" ] || echo -e "\e]51;$(pwd)\e\\" + [ "$OLDPWD" = "$PWD" ] || echo -e "\e]51;A$(pwd)\e\\" } ``` @@ -123,7 +123,7 @@ Put this in your *remote* .zshrc: ```zsh function chpwd() { - print -Pn "\e]51;$(whoami)@$(hostname):$(pwd)\e\\" + print -Pn "\e]51A;$(whoami)@$(hostname):$(pwd)\e\\" } ``` diff --git a/vterm-module.c b/vterm-module.c index d47cb61..a4f9918 100644 --- a/vterm-module.c +++ b/vterm-module.c @@ -654,13 +654,13 @@ static int osc_callback(const char *command, size_t cmdlen, void *user) { buffer[cmdlen] = '\0'; memcpy(buffer, command, cmdlen); - if (cmdlen > 3 && buffer[0] == '5' && buffer[1] == '1' && buffer[2] == ';') { + if (cmdlen > 4 && buffer[0] == '5' && buffer[1] == '1' && buffer[2] == ';'&& buffer[3] == 'A') { if (term->directory != NULL) { free(term->directory); term->directory = NULL; } - term->directory = malloc(cmdlen - 3 + 1); - strcpy(term->directory, &buffer[3]); + term->directory = malloc(cmdlen - 4 + 1); + strcpy(term->directory, &buffer[4]); term->directory_changed = true; return 1; } |
