fix: correct nightly tag, fix tmux startup, full-word suggestions only, and keep current dir on reload (#8)
- correct nightly release tag name 989b61eefb212c18ca04b2121b382f19f86e39c2 - iris not start in tmux 0fef95430b6a1877810e3a4ffd8aa658f75c542c - suggestions only show on full word typing f29cbfd74a2d90371f8f369e6f8e7419f979da38 - keep current dir on reload instead of return home dir a923e78f52a95e06587aff6856a6a81319b38e84
This commit is contained in:
@@ -29,6 +29,7 @@ jobs:
|
|||||||
id: version
|
id: version
|
||||||
run: |
|
run: |
|
||||||
BASE=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
|
BASE=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
|
||||||
|
BASE=${BASE%%-nightly*}
|
||||||
SHORT=$(git rev-parse --short HEAD)
|
SHORT=$(git rev-parse --short HEAD)
|
||||||
echo "version=${BASE}-nightly.${SHORT}" >> $GITHUB_OUTPUT
|
echo "version=${BASE}-nightly.${SHORT}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
|||||||
@@ -145,9 +145,11 @@ func SearchHistory(query string) ([]HistResult, error) {
|
|||||||
// when query has a clear first word, only keep history entries that share the same first word
|
// 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 ..."
|
// this prevents e.g. curl commands from showing up when typing "git ..."
|
||||||
queryFirstWord := ""
|
queryFirstWord := ""
|
||||||
|
if strings.IndexByte(query, ' ') != -1 {
|
||||||
if fields := strings.Fields(query); len(fields) > 0 {
|
if fields := strings.Fields(query); len(fields) > 0 {
|
||||||
queryFirstWord = strings.ToLower(fields[0])
|
queryFirstWord = strings.ToLower(fields[0])
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var results []HistResult
|
var results []HistResult
|
||||||
for _, m := range matches {
|
for _, m := range matches {
|
||||||
|
|||||||
@@ -23,6 +23,12 @@ For example, add this to your ~/.zshrc:
|
|||||||
case "bash", "zsh":
|
case "bash", "zsh":
|
||||||
fmt.Printf(`
|
fmt.Printf(`
|
||||||
# Iris Autostart Hook
|
# 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
|
if [ -z "$IRIS_PID" ]; then
|
||||||
export IRIS_ACTIVE_SHELL="%s"
|
export IRIS_ACTIVE_SHELL="%s"
|
||||||
exec iris
|
exec iris
|
||||||
@@ -31,6 +37,14 @@ fi
|
|||||||
case "fish":
|
case "fish":
|
||||||
fmt.Printf(`
|
fmt.Printf(`
|
||||||
# Iris Autostart Hook
|
# 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
|
if not set -q IRIS_PID
|
||||||
set -gx IRIS_ACTIVE_SHELL "fish"
|
set -gx IRIS_ACTIVE_SHELL "fish"
|
||||||
exec iris
|
exec iris
|
||||||
|
|||||||
@@ -160,6 +160,9 @@ func runWrapper() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if c.Process != nil {
|
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)
|
_ = syscall.Kill(c.Process.Pid, syscall.SIGKILL)
|
||||||
_ = ptmx.Close()
|
_ = ptmx.Close()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user