dnkl/foot
41
2.0k
Fork
You've already forked foot
243

Open Scrollback In Editor #2161

Closed
opened 2025年08月15日 12:43:30 +02:00 by Jazztache · 5 comments

Describe your feature request

Hello!

I would like for the ability to press a keybind, and open the scrollback in a text editor. For example, in my case, it's Neovim.
From there, I can censor any SHA256 keys (if neccesary) and save the terminal scrollback into a file in my logs folder.

Tmux and Zellij have this ability. Konsole also has this as well. I use Foot with Hyprland, and I would like the ability to save the scrollback without having to remember to always open Tmux or Zellij.

This would be very convenient and great for submitting logs impromptu without having to know ahead of time if I should have used a multiplexer or not.

Thankyou!

### Describe your feature request Hello! I would like for the ability to press a keybind, and open the scrollback in a text editor. For example, in my case, it's Neovim. From there, I can censor any SHA256 keys (if neccesary) and save the terminal scrollback into a file in my logs folder. Tmux and Zellij have this ability. Konsole also has this as well. I use Foot with Hyprland, and I would like the ability to save the scrollback without having to remember to always open Tmux or Zellij. This would be very convenient and great for submitting logs impromptu without having to know ahead of time if I should have used a multiplexer or not. Thankyou!

something like

pipe-scrollback=[new-editor-window] Control+Shift+p
pipe-command-output=[new-editor-window] Control+Shift+g

where new-editor-window is something like

#!/bin/sh
set -e
f=$(mktemp)
cat >$f
foot -e $EDITOR +999999 $f
rm $f

You can also use

pipe-scrollback=[sh -c "..."] Control+Shift+p
something like ``` pipe-scrollback=[new-editor-window] Control+Shift+p pipe-command-output=[new-editor-window] Control+Shift+g ``` where new-editor-window is something like ```shellscript #!/bin/sh set -e f=$(mktemp) cat >$f foot -e $EDITOR +999999 $f rm $f ``` You can also use pipe-scrollback=[sh -c "..."] Control+Shift+p

Not working.

Welcome back! It is currently Fri Aug 15 09:27:14 PM AEST 2025
~ # cat ~/Scripts/Misc/new-editor-window.sh 
#!/bin/sh
set -e
f=$(mktemp)
cat >$f
foot -e $EDITOR +999999 $f
rm $f
~ # cat ~/.config/foot/foot.ini 
[colors]
alpha=0.7
#2123Fri15Aug25
[key-bindings]
pipe-scrollback=[bash -c "/home/jazztache/Scripts/Misc/new-editor-window.sh"] Control+Shift+p
~ # 

Thankyou for your fast response though.

Not working. ``` Welcome back! It is currently Fri Aug 15 09:27:14 PM AEST 2025 ~ # cat ~/Scripts/Misc/new-editor-window.sh #!/bin/sh set -e f=$(mktemp) cat >$f foot -e $EDITOR +999999 $f rm $f ~ # cat ~/.config/foot/foot.ini [colors] alpha=0.7 #2123Fri15Aug25 [key-bindings] pipe-scrollback=[bash -c "/home/jazztache/Scripts/Misc/new-editor-window.sh"] Control+Shift+p ~ # ``` Thankyou for your fast response though.
Owner
Copy link

The pipe-* key-bindings are the way to do this. For example, I have:

pipe-command-output=[sh -c "f=$(mktemp) && cat - > $f && footclient emacsclient-wrapper.sh -t $f; rm $f"] Control+Shift+g

This works just fine. Details are in the man page.

Note that piping (anything) to "something" in the same terminal instance is not, and never will be supported.

The `pipe-*` key-bindings are the way to do this. For example, I have: ```ini pipe-command-output=[sh -c "f=$(mktemp) && cat - > $f && footclient emacsclient-wrapper.sh -t $f; rm $f"] Control+Shift+g ``` This works just fine. Details are in the man page. Note that piping (anything) to "something" in the same terminal instance is not, and never will be supported.

Does this spawn a new foot terminal instance with the scrollback of the original terminal opened in neovim?

I hate to be a bother, but why wouldn't it be supported? Is it a technical issue with how foot is structured or just a design decision?

Does this spawn a new foot terminal instance with the scrollback of the original terminal opened in neovim? I hate to be a bother, but why wouldn't it be supported? Is it a technical issue with how foot is structured or just a design decision?
Owner
Copy link

Does this spawn a new foot terminal instance with the scrollback of the original terminal opened in neovim?

My example launches a new foot client instance (since I use foot in server mode), with the output of the last command opened in emacs. There are other pipe-* commands, for example pipe-scrollback (as already mentioned by @krobelus) that pipes, guess what, the scrollback. Again, details are in the man page. Not much point in us repeating everything written there, here.

I hate to be a bother, but why wouldn't it be supported? Is it a technical issue with how foot is structured or just a design decision?

Doing so requires spawning a new PTY instance, and then co-hosting it in the same Wayland window as the original PTY. It certainly can be done, but the added complexity is not something we want in foot.

> Does this spawn a new foot terminal instance with the scrollback of the original terminal opened in neovim? My example launches a new foot **client** instance (since I use foot in server mode), with the output of the last command opened in **emacs**. There are other `pipe-*` commands, for example `pipe-scrollback` (as already mentioned by @krobelus) that pipes, guess what, the scrollback. Again, details are in the man page. Not much point in us repeating everything written there, here. > I hate to be a bother, but why wouldn't it be supported? Is it a technical issue with how foot is structured or just a design decision? Doing so requires spawning a new PTY instance, and then co-hosting it in the same Wayland window as the original PTY. It certainly _can_ be done, but the added complexity is not something we want in foot.
Sign in to join this conversation.
No Branch/Tag specified
master
osc-5522
sixel-heap-buffer-overflow
releases/1.27
releases/1.26
releases/1.25
releases/1.24
multi-cursor
releases/1.23
pixman-16f-2
releases/1.22
releases/1.21
releases/1.20
releases/1.19
releases/1.18
releases/1.17
releases/1.16
releases/1.15
releases/1.14
releases/1.13
releases/1.12
releases/1.11
releases/1.10
releases/1.9
releases/1.8
releases/1.7
releases/1.6
releases/1.5
releases/1.4
releases/1.3
releases/1.2
releases/1.1
releases/1.0
1.27.0
1.26.1
1.26.0
1.25.0
1.24.0
1.23.1
1.23.0
1.22.3
1.22.2
1.22.1
1.22.0
1.21.0
1.20.2
1.20.1
1.20.0
1.19.0
1.18.1
1.18.0
1.17.2
1.17.1
1.17.0
1.16.2
1.16.1
1.16.0
1.15.3
1.15.2
1.15.1
1.15.0
1.14.0
1.13.1
1.13.0
1.12.1
1.12.0
1.11.0
1.10.3
1.10.2
1.10.1
1.10.0
1.9.2
1.9.1
1.9.0
1.8.2
1.8.1
1.8.0
1.7.2
1.7.1
1.7.0
1.6.4
1.6.3
1.6.2
1.6.1
1.6.0
1.5.4
1.5.3
1.5.2
1.5.1
1.5.0
1.4.4
1.4.3
1.4.2
1.4.1
1.4.0
1.3.0
1.2.3
1.2.2
1.2.1
1.2.0
1.1.0
1.0.0
0.9.0
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dnkl/foot#2161
Reference in a new issue
dnkl/foot
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?