Open anonymous1184 opened 2 years ago
Try to put kitty.ini
configuration file in %APPDATA%\KiTTY\kitty.ini directory.
Another solution is to set en environment variable KITTY_INI_FILE
that contains the full path to your kitty.ini
configuration file.
Sorry for the delayed response.
Both options work great, however both trump the whole portable operation. Is there plan to look for the .ini
in the same folder as the executables?
If you want to use it in portable mode of course you can put the kitty.ini
file directly in the same directory where executables are. See the documentation.
That's the issue., the .ini
file is not read unless starting the application in the same directory as the file.
When doing git
operations that is not possible and I have many different configurations as I manage quite a few of repositories; some of them have a git
local config with a key, some make use of the GIT_SSH
env var and some default to pageant
.
Here how to replicate.
The archive kitty-bin-0.76.0.10.zip
was extracted in D:\Apps\KiTTY
and a a file kitty.ini
was created with the following contents:
[KiTTY]
savemode=dir
autostoresshkey=yes
Now if I'm on the root of the D:\
(or any folder but the path of the executables) the configuration is not loaded (as seen on the image asking to store the key), but as soon as I change to the directory everything works.
I also tried renaming the files as their original counterparts and with my original setup which is hardlinks to so I can easily update KiTTY and keep other configurations as they are. BTW both work fine having the config file in %AppData%
or setting user/system env vars.
As a workaround, I tried using scripts (both .cmd
and .sh
for Git Bash) which change the working directory before running klink.exe
, but with that approach Ctrl+C
stops the script, cancelling the SSH session (even when running exec klink.exe
). For now I set the KITTY_INI_FILE
variable, but this is not really portable and portability was the reason to use KiTTY instead of PuTTY in the first place.
In cmd, use start
so the subprocess is created detached (same as CreateProcess()
with DETACHED_PROCESS
as dwCreationFlags
)
In cmd, use
start
so the subprocess is created detached (same asCreateProcess()
withDETACHED_PROCESS
asdwCreationFlags
)
I also tried doing that, but then the SSH session opens in a new window (instead of using the current PowerShell tab), uses different font settings and doesn’t handle color codes (instead it displays them as text and makes beeping noises).
If
klink
(perhaps all of the utilities?) are invoked with an starting directory other than the utility's root the configuration file is not loaded.I was using
git
and thesshCommand
option isklink
with a private key. Since the configuration file wasn't loaded the option to automatically store the server SSH key wasn't in effect puttinggit
in the limbo as I couldn't interact. The workaround was to put akitti.ini
with a fixedconfigdir
in the directory where I was about to clone,git
dir and the repo dir (as I needed to clone, edit and commit/push).