add preview into active sessions
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user