Last active
September 27, 2023 15:10
-
-
Save ZaWertun/e2cdd1412e6a4abcccf842c6f8707264 to your computer and use it in GitHub Desktop.
Enables semantic integration for the fish shell in the KDE Konsole terminal emulator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/fish | |
# Append this lines to ~/.config/fish/config.fish for automatic start: | |
# ``` | |
# if functions -q konsole_semantic_integration | |
# konsole_semantic_integration | |
# end | |
# ``` | |
function konsole_semantic_integration | |
set -l parent_pid (ps -o ppid= %self |string trim) | |
set -l parent_comm (ps -o comm= $parent_pid) | |
if string match -q konsole $parent_comm | |
function __konsole_semantic_prompt --on-event fish_prompt | |
printf "\e]133;A\a\e]133;B\a" | |
end | |
function __konsole_semantic_postexec --on-event fish_postexec | |
printf "\e]133;A\a\e]133;D;"$status | |
end | |
function __konsole_semantic_cancel --on-event fish_cancel | |
printf "\e]133;A\a" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment