diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 55befed..362fa16 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -29,6 +29,7 @@ jobs: id: version run: | BASE=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0") + BASE=${BASE%%-nightly*} SHORT=$(git rev-parse --short HEAD) echo "version=${BASE}-nightly.${SHORT}" >> $GITHUB_OUTPUT diff --git a/integration/history.go b/integration/history.go index d350d77..6f5e7d5 100644 --- a/integration/history.go +++ b/integration/history.go @@ -145,8 +145,10 @@ func SearchHistory(query string) ([]HistResult, error) { // when query has a clear first word, only keep history entries that share the same first word // this prevents e.g. curl commands from showing up when typing "git ..." queryFirstWord := "" - if fields := strings.Fields(query); len(fields) > 0 { - queryFirstWord = strings.ToLower(fields[0]) + if strings.IndexByte(query, ' ') != -1 { + if fields := strings.Fields(query); len(fields) > 0 { + queryFirstWord = strings.ToLower(fields[0]) + } } var results []HistResult diff --git a/root/init.go b/root/init.go index 62b68d3..2d8944f 100644 --- a/root/init.go +++ b/root/init.go @@ -23,6 +23,12 @@ For example, add this to your ~/.zshrc: case "bash", "zsh": fmt.Printf(` # Iris Autostart Hook +if [ -n "$TMUX" ] && [ -n "$IRIS_PID" ]; then + if ps -o comm= -p $PPID 2>/dev/null | grep -q "tmux"; then + unset IRIS_PID IRIS_IS_CHILD IRIS_FD + fi +fi + if [ -z "$IRIS_PID" ]; then export IRIS_ACTIVE_SHELL="%s" exec iris @@ -31,6 +37,14 @@ fi case "fish": fmt.Printf(` # Iris Autostart Hook +if set -q TMUX; and set -q IRIS_PID + if ps -o comm= -p $PPID 2>/dev/null | grep -q "tmux" + set -e IRIS_PID + set -e IRIS_IS_CHILD + set -e IRIS_FD + end +end + if not set -q IRIS_PID set -gx IRIS_ACTIVE_SHELL "fish" exec iris diff --git a/root/wrapper.go b/root/wrapper.go index cfc797f..547928a 100644 --- a/root/wrapper.go +++ b/root/wrapper.go @@ -160,6 +160,9 @@ func runWrapper() { } if c.Process != nil { + if cwd, err := os.Readlink(fmt.Sprintf("/proc/%d/cwd", c.Process.Pid)); err == nil { + _ = os.Chdir(cwd) + } _ = syscall.Kill(c.Process.Pid, syscall.SIGKILL) _ = ptmx.Close() }