kovidgoyal / kitty

Cross-platform, fast, feature-rich, GPU based terminal
https://sw.kovidgoyal.net/kitty/
GNU General Public License v3.0
24.41k stars 980 forks source link

All child processes fail to launch #1519

Closed Jomik closed 5 years ago

Jomik commented 5 years ago

I get the following error trying to use kitty +kitten ssh myserver, and similar for +complete and the likes. Even kitty list-fonts fails.

The error is sadly not very helpful to me, I know my setup is non-standard, as I am on NixOS, but I don't know what it is looking for, so I can not fix/patch it.

Failed to launch child: +kitten
With error: No such file or directory
Press Enter to exit.
➜ kitty --debug-config
kitty 0.13.3 created by Kovid Goyal
Linux tamaskan 4.19.32 #1-NixOS SMP Wed Mar 27 05:14:43 UTC 2019 x86_64
Running under: X11
<<< Welcome to NixOS 19.03beta171931.3a4ffdd38b5 (\m) - \l >>>

Run `nixos-help` for the NixOS manual.
Loaded config files: /nix/store/421whnqj91igvs6hmphyq84krldzcpr9-kitty.conf

Config options different from defaults:
background            Color(red=251, green=241, blue=199)
color0                Color(red=251, green=241, blue=199)
color1                Color(red=157, green=0, blue=6)
color10               Color(red=152, green=151, blue=26)
color11               Color(red=215, green=153, blue=33)
color12               Color(red=69, green=133, blue=136)
color13               Color(red=177, green=98, blue=134)
color14               Color(red=104, green=157, blue=106)
color15               Color(red=40, green=40, blue=40)
color2                Color(red=121, green=116, blue=14)
color3                Color(red=181, green=118, blue=20)
color4                Color(red=7, green=102, blue=120)
color5                Color(red=143, green=63, blue=113)
color6                Color(red=66, green=123, blue=88)
color7                Color(red=40, green=40, blue=40)
color8                Color(red=146, green=131, blue=116)
color9                Color(red=204, green=36, blue=29)
cursor                Color(red=80, green=73, blue=69)
cursor_blink_interval 0
cursor_text_color     None
font_family           Fira Code Retina
foreground            Color(red=40, green=40, blue=40)
scrollback_lines      10000
selection_background  Color(red=40, green=40, blue=40)
selection_foreground  Color(red=213, green=196, blue=161)
kovidgoyal commented 5 years ago

That indicates kitty is not running kittens but instead trying to open a new window with +whatever as the program to run in it. Which will happen only if you are running a very old kitty or you have one somewhere in your path or the command line arguments being passed to kitty are incorrect.

Jomik commented 5 years ago

@kovidgoyal so, I am running latest release, 0.13.3, and I only have that kitty in my path. I am pretty certain it is a bit with my installation, as I use Nix.. But I would like to debug it, I just can't seem to get a more useful error message. Is there a way I can see what exact path it is trying to execute?

kovidgoyal commented 5 years ago

It tells you exactly what it is executing, in this case +whatever.

If you want to debug, look in the main() function in main.py that is where it decides whether to run kitty itself or a kitten or remote control, etc.

Jomik commented 5 years ago

@kovidgoyal I used strace -vfefile kitty list-fonts and it looks like it is using for a list-fonts executable in my PATH. And when I do kitty +kititen ssh it seems to look for a +kitten program in my PATH.

kovidgoyal commented 5 years ago

That is what I told you in my previous comment.

Jomik commented 5 years ago

Solved it. The error was that I had kitty linked to a script that looks like

#!/usr/bin/env bash
export PATH='/nix/store/kitty-0.13.3/bin:/nix/store/imagemagick-6.9.9-34/bin:/nix/store/xsel-unstable-2018-01-10/bin'${PATH:+':'}$PATH
 exec -a "$0" "/nix/store/kitty-0.13.3/bin/.kitty-wrapped"  --config /nix/store/kitty.conf "${extraFlagsArray[@]}" "$@"

I removed the --config flag and just set the KITTY_CONFIG_DIR environment variable instead. Seems there is a bug if you call kitty with --config and then try to launch any child, unless that is just not supported.

kovidgoyal commented 5 years ago

--config is a commnd line option for kitty, not for kittens, which have their own unique set of command line arguments. Indeed, some of them have their own different config files. You cannot pass the kittyconfig arg to kittens, only to kitty itself.

Jomik commented 5 years ago

@kovidgoyal The --config option is being passed to kitty, not a kitten.

kovidgoyal commented 5 years ago

When you run kitty +whatever you are running a kitten not kitty.

Jomik commented 5 years ago

I ran kitty --config /my/config/dir/kitty.conf +kitten ssh myserver ..?

Jomik commented 5 years ago

Either way, it does work now, by not using --config, but the environment variable, so all is good :)

kovidgoyal commented 5 years ago

If you want to run a kitten you have to make + the first argument to kitty. If you put it after --config it will not work.

So when you do

kitty --config x +kitten ssh

you are telling kitty to run itself using the config file x and starting the program +kitten witht he arguments ssh

Jomik commented 5 years ago

@kovidgoyal Ah, that does make sense. So I can not pass a configuration file to kitty, if I want to run a kitten. But I guess it does not actually make sense to pass a config file when starting a kitten! Thank you for clarifying! And thanks for the terminal, it's awesome :+1:

kovidgoyal commented 5 years ago

You're welcome :)

alephnull commented 4 years ago

I want to launch a new kitty os window running the ssh kitten and pass some command line arguments to the containing kitty, so I came up with:

alias goto='kitty -o background_image=${bg_img} -o background_image_layout=scaled +kitten ssh $*'

$bg_img is generated on the fly and is different for each host (it is an image of the hostname). Alas, the limitation of not being able to pass dynamic config to the kitty invocation when also launching a kitty gets in the way. The options parsing code is quite hairy but I think https://github.com/kovidgoyal/kitty/blob/master/kitty/cli.py#L514 is the condition that decides if we should go into "kitten mode" or proceed as normal.

kovidgoyal commented 4 years ago

if you want to run the ssh kitten inside a new kitty, you do this:

kitty --config whatever -o whatever -o whatever kitty +kitten ssh whatever
alephnull commented 4 years ago

Apologies for the necro-bump, but not sure if a new issue is appropriate when the behaviour is intentional.

kovidgoyal commented 4 years ago

What behavior?? I showed you how to pass dynamic config to kitty when running a kitten inside a new kitty instance.

alephnull commented 4 years ago

I posted that on a stale form that had not been refreshed. Your fix works, got lost in a maze of kitty invocations :)

spik3 commented 5 months ago

I'm tring to install Kitty to pi and I get this popup. Failed to execute child process "/home/pi/.local/kitty.app/bin/kitty" (No such file or directory) it would be great to sort this out.