diff --git a/bashrc.sh b/bashrc.sh index 54b77d7..a768878 100644 --- a/bashrc.sh +++ b/bashrc.sh @@ -59,7 +59,6 @@ precmd() { -login "$__RESH_LOGIN" \ -path "$__RESH_PATH" \ -pwd "$__RESH_PWD" \ - -realPwd "$(realpath $__RESH_PWD)" \ -shell "$__RESH_SHELL" \ -term "$__RESH_TERM" \ -pid "$__RESH_PID" -shellPid "$__RESH_SHELL_PID" \ diff --git a/collect/resh-collect.go b/collect/resh-collect.go index ef66457..4c50b9f 100644 --- a/collect/resh-collect.go +++ b/collect/resh-collect.go @@ -53,7 +53,6 @@ func main() { windowId := flag.Int("windowId", -1, "$WINDOWID - session id") shlvl := flag.Int("shlvl", -1, "$SHLVL") - realPwd := flag.String("realPwd", "", "realpath $PWD") host := flag.String("host", "", "$HOSTNAME") hosttype := flag.String("hosttype", "", "$HOSTTYPE") ostype := flag.String("ostype", "", "$OSTYPE") @@ -95,6 +94,12 @@ func main() { realtimeBeforeLocal := realtimeBefore + timezoneBeforeOffset realtimeAfterLocal := realtimeAfter + timezoneAfterOffset + realPwd, err := filepath.EvalSymlinks(*pwd) + if err != nil { + log.Println("err while handling realpath:", err) + realPwd = "" + } + gitDir, gitRealDir := getGitDirs(*gitCdup, *gitCdupExitCode, *pwd) if *gitRemoteExitCode != 0 { *gitRemote = "" @@ -119,15 +124,15 @@ func main() { Term: *term, // non-posix - RealpathPwd: *realPwd, - Pid: *pid, - ShellPid: *shellPid, - WindowId: *windowId, - Host: *host, - Hosttype: *hosttype, - Ostype: *ostype, - Machtype: *machtype, - Shlvl: *shlvl, + RealPwd: realPwd, + Pid: *pid, + ShellPid: *shellPid, + WindowId: *windowId, + Host: *host, + Hosttype: *hosttype, + Ostype: *ostype, + Machtype: *machtype, + Shlvl: *shlvl, // before after TimezoneBefore: *timezoneBefore, diff --git a/common/resh-common.go b/common/resh-common.go index 70772e0..97a4bb1 100644 --- a/common/resh-common.go +++ b/common/resh-common.go @@ -18,7 +18,7 @@ type Record struct { Term string `json:"term"` // non-posix"` - RealpathPwd string `json:"realpathPwd"` + RealPwd string `json:"realPwd"` Pid int `json:"pid"` ShellPid int `json:"shellPid"` WindowId int `json:"windowId"`