Question in the body about "close_on_child_death" setting
I use kitty terminal with fish shell. I have a fish function that will run a command on a file and be detached. For instance, I want to start kwrite (or libreoffice) with a certain text file detached and disowned so I can close the terminal and still keep kwrite open. below is the function I called detfun (for detach-function in my mind):
function detfun --description 'Run a command on a file in the background natively' if test (count $argv) -lt 2 echo "Usage: detfun <COMMAND> <FILE>" return 1 end
# Native Fish background syntax replaces nohup
$argv[1] $argv[2] >/dev/null 2>&1 &
# Detach the job completely so closing the terminal won't kill it
disown
end
When I run this in other terminal, it behaves as I want it. To run with kitty I had to change the setting to yes as shown below:
close_on_child_death yes
And now "detfun" works correctly. It mentions there may be some error as "their stdout/stderr/stdin no longer work."
It seems to work fine. Is there a better way to do what I am trying to do with fish/kitty?