69410e702014b6f6f09f659a5747c5a6ace7a09a

Author
fossdd <fossdd@pwned.life>
Committer
GitHub <noreply@github.com>
Date

Message

feat(foot): add foot plugin (#12849)

Diff

 1diff --git a/plugins/foot/README.md b/plugins/foot/README.md
 2new file mode 100644
 3index 0000000000000000000000000000000000000000..67777d9fa8e7b23d7115086b8376632b93becce1
 4--- /dev/null
 5+++ b/plugins/foot/README.md
 6@@ -0,0 +1,35 @@
 7+# foot
 8+
 9+This plugin adds shell integration for [foot, a fast, lightweight and
10+minimalistic Wayland terminal emulator](https://codeberg.org/dnkl/foot).
11+
12+To use, add `foot` to the list of plugins in your `.zshrc` file:
13+
14+```zsh
15+plugins=(... foot)
16+```
17+
18+## Spawning new terminal instances in the current working directory
19+
20+When spawning a new terminal instance (with `ctrl+shift+n` by default), the new
21+instance will start in the current working directory.
22+
23+## Jumping between prompts
24+
25+Foot can move the current viewport to focus prompts of already executed
26+commands (bound to ctrl+shift+z/x by default).
27+
28+## Piping last command's output
29+
30+The key binding `pipe-command-output` can pipe the last command's output to an
31+application of your choice (similar to the other `pipe-*` key bindings):
32+
33+```
34+[key-bindings]
35+pipe-command-output=[sh -c "f=$(mktemp); cat - > $f; footclient emacsclient -nw $f; rm $f"] Control+Shift+g
36+```
37+
38+When pressing ctrl+shift+g, the last command's output is written to a
39+temporary file, then an emacsclient is started in a new footclient instance.
40+The temporary file is removed after the footclient instance has closed.
41+
42diff --git a/plugins/foot/foot.plugin.zsh b/plugins/foot/foot.plugin.zsh
43new file mode 100644
44index 0000000000000000000000000000000000000000..c1d077e26dd14cd8c07c5c27cd2abd9de673a3e3
45--- /dev/null
46+++ b/plugins/foot/foot.plugin.zsh
47@@ -0,0 +1,10 @@
48+function precmd {
49+  print -Pn "\e]133;A\e\\"
50+  if ! builtin zle; then
51+    print -n "\e]133;D\e\\"
52+  fi
53+}
54+
55+function preexec {
56+  print -n "\e]133;C\e\\"
57+}