terminal: correctly gueses path separator used in source files paths (#1418)
Fixes an error in wrongly appending os.PathSeparator to source file path on Windows in case of path substitution config option.
This commit is contained in:
parent
53957e9f4d
commit
c7399ac278
@ -264,7 +264,14 @@ func (t *Term) substitutePath(path string) string {
|
||||
if t.conf == nil {
|
||||
return path
|
||||
}
|
||||
separator := string(os.PathSeparator)
|
||||
|
||||
// On windows paths returned from headless server are as c:/dir/dir
|
||||
// though os.PathSeparator is '\\'
|
||||
|
||||
separator := "/" //make it default
|
||||
if strings.Index(path, "\\") != -1 { //dependent on the path
|
||||
separator = "\\"
|
||||
}
|
||||
for _, r := range t.conf.SubstitutePath {
|
||||
from := crossPlatformPath(r.From)
|
||||
to := r.To
|
||||
|
||||
Loading…
Reference in New Issue
Block a user