Move hooks to a dedicated module. This allows for greater flexibility and easier editing. TODO: Make hook handling neater (possibly through parsing the hook script to read an "hook-to" marker that allows for automated loading of properly formatted hook functions)
14 lines
335 B
Bash
14 lines
335 B
Bash
## output the current directory in the correct format for foot.
|
|
|
|
function osc7 {
|
|
local LC_ALL=C
|
|
export LC_ALL
|
|
|
|
setopt localoptions extendedglob
|
|
input=( ${(s::)PWD} )
|
|
uri=${(j::)input/(#b)([^A-Za-z0-9_.\!~*\'\(\)-\/])/%${(l:2::0:)$(([##16]#match))}}
|
|
print -n "\e]7;file://${HOSTNAME}${uri}\e\\"
|
|
}
|
|
|
|
# vim: ft=zsh
|