chrisant996 / clink

Bash's powerful command line editing in cmd.exe
https://chrisant996.github.io/clink/
GNU General Public License v3.0
3.61k stars 142 forks source link

`clink config prompt show ...` errors #698

Open andry81 opened 1 day ago

andry81 commented 1 day ago

clink config prompt show oh-my-posh

Current Prompt
w:\test>

oh-my-posh
Need help installing oh-my-posh?  Visit here:
https://ohmyposh.dev/docs/installation/windows

Unable to get oh-my-posh script from "oh-my-posh.exe".
Error while activating custom prompt 'C:\Programs\Tools\Console\chrisant996.github.io\clink\themes\oh-my-posh.clinkprompt'.

clink config prompt show pure

Current Prompt
w:\test>

pure

prompt filter failed:
...sole\chrisant996.github.io\clink\themes\pure.clinkprompt:215: attempt to concatenate field 'git_branch' (a nil value)
stack traceback:
        ...sole\chrisant996.github.io\clink\themes\pure.clinkprompt:311: in function 'format_modules'
        ...sole\chrisant996.github.io\clink\themes\pure.clinkprompt:330: in function 'func'
        ~clink~/app/prompt.lua:137: in function <~clink~/app/prompt.lua:124>
        [C]: in function 'xpcall'
        ~clink~/app/prompt.lua:191: in function <~clink~/app/prompt.lua:105>
        (...tail calls...)
        ~clink~/app/config.lua:325: in function '_show_prompt_demo'
        ~clink~/app/loader_config.lua:834: in function <~clink~/app/loader_config.lua:777>
        (...tail calls...)

ERROR IN LUA PROMPT FILTER

clink info

version          : 1.7.3.f8fb96
session          : 1084
injected         : clink_dll_x64.dll
binaries         : C:\Programs\Tools\Console\chrisant996.github.io\clink
state            : C:\Users\User\AppData\Local\clink
log              : C:\Users\User\AppData\Local\clink\clink.log
default settings : C:\Programs\Tools\Console\chrisant996.github.io\clink\default_settings
settings         : C:\Users\User\AppData\Local\clink\clink_settings
history          : C:\Users\User\AppData\Local\clink\clink_history
scripts          : C:\Programs\Tools\Console\chrisant996.github.io\clink ; C:\Users\User\AppData\Local\clink
default_inputrc  : C:\Programs\Tools\Console\chrisant996.github.io\clink\default_inputrc
inputrc          : %clink_inputrc%
                     (unset)
                 : state directory
                     C:\Users\User\AppData\Local\clink\.inputrc
                     C:\Users\User\AppData\Local\clink\_inputrc
                 : %userprofile%
                     C:\Users\User\.inputrc
                     C:\Users\User\_inputrc
                 : %localappdata%
                     C:\Users\User\AppData\Local\.inputrc
                     C:\Users\User\AppData\Local\_inputrc
                 : %appdata%
                     C:\Users\User\AppData\Roaming\.inputrc
                     C:\Users\User\AppData\Roaming\_inputrc
                 : %home%
                     C:\Users\User\.inputrc
                     C:\Users\User\_inputrc
system           : 6.3.09600.20778
codepage         : 1251
keyboard langid  : 1033
keyboard layout  : 00000409
chrisant996 commented 1 day ago

clink config prompt show oh-my-posh

Current Prompt
w:\test>

oh-my-posh
Need help installing oh-my-posh?  Visit here:
https://ohmyposh.dev/docs/installation/windows

Unable to get oh-my-posh script from "oh-my-posh.exe".
Error while activating custom prompt 'C:\Programs\Tools\Console\chrisant996.github.io\clink\themes\oh-my-posh.clinkprompt'.

@andry81 Is the oh-my-posh program installed? The link in the error message has info on how to install it.

Also refer to Clink's documentation on how to use oh-my-posh.

Is the error message missing information that would help make it clear how to set up the oh-my-posh program?

clink config prompt show pure

...
...sole\chrisant996.github.io\clink\themes\pure.clinkprompt:215: attempt to concatenate field 'git_branch' (a nil value)
...

Confirmed. Thanks for reporting it.

chrisant996 commented 1 day ago

...sole\chrisant996.github.io\clink\themes\pure.clinkprompt:215: attempt to concatenate field 'git_branch' (a nil value)

Fixed by 2887fc878cf01c7a1f0ebe55f6cac908647ea275.