mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
terminal: trim CWD slash #11762
Trailing CWD slash in term:// buffer name breaks the BufReadCmd
handler.
Before:
term://~///25232:/bin/bash
After:
term://~//25232:/bin/bash
ref c6ff23d7a0
ref #11289
This commit is contained in:
parent
c6ff23d7a0
commit
07a105f0cb
@ -18386,7 +18386,12 @@ static void f_termopen(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
// "./…" => "/home/foo/…"
|
||||
vim_FullName(cwd, (char *)NameBuff, sizeof(NameBuff), false);
|
||||
// "/home/foo/…" => "~/…"
|
||||
home_replace(NULL, NameBuff, IObuff, sizeof(IObuff), true);
|
||||
size_t len = home_replace(NULL, NameBuff, IObuff, sizeof(IObuff), true);
|
||||
// Trim slash.
|
||||
if (IObuff[len - 1] == '\\' || IObuff[len - 1] == '/') {
|
||||
IObuff[len - 1] = '\0';
|
||||
}
|
||||
|
||||
// Terminal URI: "term://$CWD//$PID:$CMD"
|
||||
snprintf((char *)NameBuff, sizeof(NameBuff), "term://%s//%d:%s",
|
||||
(char *)IObuff, pid, cmd);
|
||||
|
Loading…
Reference in New Issue
Block a user