add preview into active sessions
This commit is contained in:
@@ -92,6 +92,12 @@ func main() {
|
|||||||
}
|
}
|
||||||
slices.Sort(seshNames)
|
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{
|
options := []fuzzyfinder.Option{
|
||||||
fuzzyfinder.WithPreviewWindow(
|
fuzzyfinder.WithPreviewWindow(
|
||||||
func(i, width, height int) string {
|
func(i, width, height int) string {
|
||||||
@@ -100,6 +106,10 @@ func main() {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
seshName := seshNames[i]
|
seshName := seshNames[i]
|
||||||
|
content, ok := printSeshContents(seshName)
|
||||||
|
if ok {
|
||||||
|
return content
|
||||||
|
}
|
||||||
windows, _ := config[seshName]
|
windows, _ := config[seshName]
|
||||||
builder := strings.Builder{}
|
builder := strings.Builder{}
|
||||||
for _, window := range windows {
|
for _, window := range windows {
|
||||||
|
|||||||
Reference in New Issue
Block a user