add preview into active sessions

This commit is contained in:
Ivar Fatland
2026-07-22 23:56:30 +02:00
parent 4e87bcfb43
commit e29fd6214f
+10
View File
@@ -92,6 +92,12 @@ func main() {
}
slices.Sort(seshNames)
printSeshContents := func(name string) (content string, ok bool) {
cmd := exec.Command(tmux, "capture-pane", "-epN", "-t", name)
stdout, err := cmd.Output()
return string(stdout), err == nil
}
options := []fuzzyfinder.Option{
fuzzyfinder.WithPreviewWindow(
func(i, width, height int) string {
@@ -100,6 +106,10 @@ func main() {
return ""
}
seshName := seshNames[i]
content, ok := printSeshContents(seshName)
if ok {
return content
}
windows, _ := config[seshName]
builder := strings.Builder{}
for _, window := range windows {