minor change

pull/3/head
Simon Let 7 years ago
parent 05a296d218
commit 8b40a332c1
  1. 5
      bashrc.sh
  2. 21
      collect/resh-collect.go
  3. 2
      common/resh-common.go

@ -2,6 +2,7 @@
PATH=$PATH:~/.resh/bin
export __RESH_RT_SESSION=$EPOCHREALTIME
export __RESH_RT_SESS_SINCE_BOOT=$(cat /proc/uptime | cut -d' ' -f1)
export __RESH_SESSION_ID=$RANDOM
nohup resh-daemon &>/dev/null & disown
preexec() {
@ -24,7 +25,7 @@ preexec() {
# non-posix
__RESH_PID="$BASHPID" # current pid
__RESH_SESSION_PID="$$" # pid of original shell
__RESH_SHELL_PID="$$" # pid but subshells don't affect it
__RESH_WINDOWID="$WINDOWID" # session
__RESH_HOST="$HOSTNAME"
__RESH_HOSTTYPE="$HOSTTYPE"
@ -54,7 +55,7 @@ precmd() {
-pwd "$__RESH_PWD" \
-shell "$__RESH_SHELL" \
-term "$__RESH_TERM" \
-pid "$__RESH_PID" -sessionPid "$__RESH_SESSION_PID" \
-pid "$__RESH_PID" -shellPid "$__RESH_SHELL_PID" \
-windowId "$__RESH_WINDOWID" \
-host "$__RESH_HOST" \
-hosttype "$__RESH_HOSTTYPE" \

@ -45,7 +45,8 @@ func main() {
// non-posix
pid := flag.Int("pid", -1, "$PID")
sessionPid := flag.Int("sessionPid", -1, "$$")
shellPid := flag.Int("shellPid", -1,
"$$ (pid but subshells don't affect it)")
windowId := flag.Int("windowId", -1, "$WINDOWID - session id")
shlvl := flag.Int("shlvl", -1, "$SHLVL")
@ -104,14 +105,14 @@ func main() {
Term: *term,
// non-posix
Pid: *pid,
SessionPid: *sessionPid,
WindowId: *windowId,
Host: *host,
Hosttype: *hosttype,
Ostype: *ostype,
Machtype: *machtype,
Shlvl: *shlvl,
Pid: *pid,
ShellPid: *shellPid,
WindowId: *windowId,
Host: *host,
Hosttype: *hosttype,
Ostype: *ostype,
Machtype: *machtype,
Shlvl: *shlvl,
// before after
TimezoneBefore: *timezoneBefore,
@ -127,7 +128,7 @@ func main() {
RealtimeSinceBoot: realtimeSinceBoot,
GitWorkTree: getGitDir(),
MachineId: getMachineId(),
MachineId: getMachineId(),
}
sendRecord(rec, strconv.Itoa(config.Port))
}

@ -19,7 +19,7 @@ type Record struct {
// non-posix"`
Pid int `json:"pid"`
SessionPid int `json:"sessionPid"`
ShellPid int `json:"shellPid"`
WindowId int `json:"windowId"`
Host string `json:"host"`
Hosttype string `json:"hosttype"`

Loading…
Cancel
Save