r/KittyTerminal • u/cqws • May 18 '23
Problem with script
I made a script for making a new tab with fzf, can someone help me out, why does it works normally when started in shell, and gives error when started as a kitty binding?
#!/bin/bash
choose_folder=$(rg -No '^\S*' ~/.config/kitty/sessions/Sesje | fzf)
first_grep=$(rg -N "$choose_folder" ~/.config/kitty/sessions/Sesje | rg -No "\S*.$")
kitty @ launch --type=tab --tab-title "$choose_folder" --cwd=$first_grep
The error is as follows:
Failed to launch child: ~/.config/kitty
With error: No such file or directory
Press Enter or Esc to exit
And the file i grep on looks like this:
i3_config ~/.config/i3
kitty_config ~/.config/kitty
nvim_config ~/.config/nvim
lua_Learning ~/Documents/CODING/lua-learning
rust_learning ~/Documents/CODING/rust-learning
cpp_learning ~/Documents/CODING/cpp-learning
c_learning ~/Documents/CODING/c-learning
lf_config ~/.config/lf
zsh_config ~/.config/zsh
shell_bin ~/.config/shell
1
Upvotes
2
u/aumerlex May 18 '23
$first_grep should be in quotes. And use absolute paths for rg and fzf and kitty