Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: failed to launch child: nvim #240

Closed
MrSeaWave opened this issue May 11, 2024 · 9 comments
Closed

bug: failed to launch child: nvim #240

MrSeaWave opened this issue May 11, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@MrSeaWave
Copy link

MrSeaWave commented May 11, 2024

when I press kitty_mod+h, I got this failed message

Failed to launch child: nvim
With error: No such file or directory
Press Enter or Esc to exit

my nvim path is:

➜ which nvim
/opt/homebrew/bin/nvim

➜ nvim -v
NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1703358377

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.9.5/share/nvim"

Run :checkhealth for more info

➜ kitty -v
kitty 0.34.1 created by Kovid Goyal

what should I do?

@mikesmithgh mikesmithgh changed the title Failed to launch child: nvim bug: failed to launch child: nvim May 15, 2024
@mikesmithgh mikesmithgh added the bug Something isn't working label May 15, 2024
@mikesmithgh
Copy link
Owner

Hi @MrSeaWave, I am not sure why Kitty is failing to find your nvim.

Here are a couple things you can check:

Please let me know if that helps

@MrSeaWave
Copy link
Author

Sorry, I can't understand what exe_search_path should be filled in. I have create ~/.config/kitty/macos-launch-services-cmdline file.

image

Debug kitty configuration:

kitty debug

@mikesmithgh
Copy link
Owner

Hi @MrSeaWave sorry for the delay, are you still seeing this problem?

If so, could you try with branch debug-240?

In kitty, run the command kitty to open a new window. Then in the newly opened window press kitty_mod+h. It should log print statements to the previous window that you used to run the kitty command.

The output should look something like:

$ kitty

=== kitty-scrollback.nvim debugging start ===

which nvim: /Users/mike/bin/nvim

kitty command: launch --copy-env --env KITTY_SCROLLBACK_NVIM=true --type overlay --title kitty-scrollback.nvim --cwd /Users/mike/gitrepos/kitty-scrollback.nvim nvim --cmd  lua vim.api.nvim_create_autocmd([[VimEnter]], {  group = vim.api.nvim_create_augroup([[KittyScrollBackNvimVimEnter]], { clear = true }),  pattern = [[*]],  callback = function()  vim.opt.runtimepath:append([[/Users/mike/gitrepos/kitty-scrollback.nvim]])   vim.api.nvim_exec_autocmds([[User]], { pattern = [[KittyScrollbackLaunch]], modeline = false })  require([[kitty-scrollback.launch]]).setup_and_launch([[{"kitty_path": "/Applications/kitty.app/Contents/MacOS/kitty", "kitty_scrollback_config": "ksb_builtin_get_text_all", "scrolled_by": 0, "cursor_x": 14, "cursor_y": 3, "lines": 48, "columns": 105, "window_id": 1, "window_title": "~/gitrepos/kitty-scrollback.nvim", "ksb_dir": "/Users/mike/gitrepos/kitty-scrollback.nvim", "kitty_opts": {"shell_integration": ["no-cursor", "enabled"], "scrollback_fill_enlarged_window": true, "scrollback_lines": 2000, "scrollback_pager": ["/opt/homebrew/bin/less", "--ignore-case", "--status-column", "--no-init", "--raw-control-chars", "--chop-long-lines", "+INPUT_LINE_NUMBER", "--use-color", "--color=P0.7$", "--prompt=?f \uea7b %f : \udb80\udd1b (kitty) .?m(%T %i of %m) .?lt\ue0a1 %lt-%lb?L/%L. .\udb86\ude05 %bB?s/%s. ?e(END) :?pB%pB\\%..%t \uf11c  v=>pipe e=>edit \ue6ae %E $"], "allow_remote_control": "socket-only", "listen_on": "unix:/tmp/kitty", "scrollback_pager_history_size": 2097152}, "kitty_config_dir": "/Users/mike/.config/kitty", "kitty_version": [0, 35, 1], "tmux": {}, "shell": "/opt/homebrew/bin/bash"}]]) end, })

=== kitty-scrollback.nvim debugging stop ===

[1.634] [PARSE ERROR] Escape codes to resize text area are not supported
[1.634] [PARSE ERROR] Unsupported screen mode:  69 (private)
[1.734] [PARSE ERROR] Escape codes to resize text area are not supported

This should let me see what happens when it attempts to find nvim and the command that kitty is attempting to run.

@MrSeaWave
Copy link
Author

@mikesmithgh Hi, when I install debug-240 code, I got this error in run kitty command and press kitty_mod+h.

image

@mikesmithgh
Copy link
Owner

@MrSeaWave sorry about that I had an issue with quotes. I'm not sure why that works for me. I fixed the issue and added a couple more debug statements, could you pull latest on debug-240 and try again?

@MrSeaWave
Copy link
Author

@mikesmithgh When I run the kitty command and press kitty_mod+h, that's fine, I can search for keywords. 👍

image

But when I press kitty_mod+h directly on the terminal. I still meet the issue😂:

image

@mikesmithgh
Copy link
Owner

😂 🤦 I think I see it and missed it earlier:

image

Could you try adding --override

So your ~/.config/kitty/macos-launch-services-cmdline looks like:

--override env=PATH="/opt/homebrew/bin"

^ actually I am not sure if that will remove other important directories in your path. You should probably echo $PATH in your shell. Then use that in ~/.config/kitty/macos-launch-services-cmdline

Mine looks like this for example:

--override env=PATH="/opt/homebrew/opt/sdkman-cli/libexec/candidates/kotlin/current/bin:/opt/homebrew/opt/sdkman-cli/libexec/candidates/java/current/bin:/opt/homebrew/opt/sdkman-cli/libexec/candidates/gradle/current/bin:/Users/mike/bin:/opt/homebrew/bin:/Users/mike/go/bin:/Users/mike/.config/pyenv/bin:/Users/mike/.config/pyenv/bin:/Users/mike/gitrepos/neovim/build/bin:/Users/mike/.cargo/bin:/opt/homebrew/opt/libpq/bin:/Users/mike/Library/Application Support/Coursier/bin:/Users/mike/.config/pyenv/shims:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/usr/local/go/bin::/opt/homebrew/opt/fzf/bin" --override env=PYENV_SHELL=bash --override env=PYENV_ROOT=/Users/mike/.config/pyenv --single-instance

Once you have --override env=PATH="your-path" in ~/.config/kitty/macos-launch-services-cmdline, completely quit kitty. Then when you reopen kitty it should read those values.

🤞 think this will work this time. This makes sense why it works when you open kitty directly from the shell because it inherits your env variables. But, Mac is odd and requires this for the initial opening of the app.

@MrSeaWave
Copy link
Author

cool!!!, I have added --override in the ~/.config/kitty/macos-launch-services-cmdline file. Everything is fine now. Thank you so much 🕺

@mikesmithgh
Copy link
Owner

giphy-downsized-large

@MrSeaWave awesome! Thanks for sticking in there 🙂. I'll have to find a place to doc this up. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants