Strip leading `-` from session name
raiguard opened this issue · comments
Caleb Heuer commented
My dotfiles repo lives in ~/.dotfiles
, so the resulting gitdir session name is -dotfiles
. This wreaks havoc with kak-lsp
and kakoune itself, the former thinking it is a command-line flag, and the latter thinking it's a switch to the command you pass %val{session}
to.
shell stderr: <<<
error: Found argument '-o' which wasn't expected, or isn't valid in this context
USAGE:
kak-lsp --daemonize --kakoune --session <SESSION>
For more information try --help
>>>
Suggested fix
Strip any non-alphanumeric characters from the front of the session name.
To reproduce
- Create a Git repo inside a hidden folder (e.g. ".test")
- Pass KKS_USE_GITDIR_SESSIONS
- Open kakoune and try to enable kak-lsp with
evaluate-commands %sh{ kak-lsp --kakoune -s $kak_session }
- Check
*debug*
and you will see kak-lsp complain about an unknown command line flag.
Gadzhi Kharkharov commented
Good catch! Thanks for using kks
:)
This should be fixed in the latest release. I've also just pushed an updated AUR package.
Caleb Heuer commented
Confirmed fixed! Thanks for the quick patch. :)