Skip to content

Instantly share code, notes, and snippets.

@ZaWertun
Last active September 27, 2023 15:10
Show Gist options
  • Save ZaWertun/e2cdd1412e6a4abcccf842c6f8707264 to your computer and use it in GitHub Desktop.
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
#!/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