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

No themes directory, but also themes and prompts not found even when it does exist #692

Closed
chrisant996 opened this issue Oct 21, 2024 · 7 comments
Labels
external The issue is due to external causes outside of Clink

Comments

@chrisant996
Copy link
Owner

chrisant996 commented Oct 21, 2024

Hi, I read in the update notes that I had to run it twice, so I had done that and updated to 1.7.3, but unfortunately it wasn't mentioned that I needed to make a new session before the second update.
Now it has updated to 1.7.3 and there is no themes/ directory. :(

Also, I tried to manually add themes/ extracted from the zip to my install location in program files (where clink.exe lives), but clink doesn't seem to recognize those. (even in a new session)

14:38:49|C:\Windows\system32>clink config theme use dracula
Theme 'dracula' not found.

14:38:53|C:\Windows\system32>clink config theme list

14:38:56|C:\Windows\system32>

Originally posted by @plutonium-239 in #681 (comment)

@chrisant996
Copy link
Owner Author

Did you manually create a themes directory in between the two updates?

Running clink update twice without starting a new session works fine to finish the update.

But if a themes directory is manually added between the two update commands, then it thinks the themes directory was successfully installed and the second update just says it's already up to date.

Can you try deleting the themes directory and then run clink update?

Originally posted by @chrisant996 in #681 (comment)

@chrisant996
Copy link
Owner Author

No, I only made that directory after the two updates, not between.
I had also tried running update (i.e. after two times) before adding the themes/ directory, but it didn't fix it. I did this once more now to confirm.

Originally posted by @plutonium-239 in #681 (comment)

@chrisant996
Copy link
Owner Author

@plutonium-239 Something unusual is going on with your computer.

Please share the following:

  • share the full output from clink info
  • share the full output from dir %=clink.bin%\themes
  • run clink config theme use dracula and then attach the clink.log file (its location is listed in the clink info output)

@chrisant996 chrisant996 changed the title No themes directory, but also themes and prompts not find even when it does exist No themes directory, but also themes and prompts not found even when it does exist Oct 21, 2024
@plutonium-239
Copy link

Here are the required logs:

14:38:56|C:\Windows\system32>clink info
version          : 1.7.3.f8fb96
session          : 32552
injected         : clink_dll_x64.dll
binaries         : C:\Program Files (x86)\clink
state            : C:\Users\pluto\AppData\Local\clink
log              : C:\Users\pluto\AppData\Local\clink\clink.log
default settings : C:\Program Files (x86)\clink\default_settings
settings         : C:\Users\pluto\AppData\Local\clink\clink_settings
history          : C:\Users\pluto\AppData\Local\clink\clink_history
scripts          : d:\dead\clink_lua_scripts\;d:\dead\clink-gizmos\;d:\dead\clink-completions\
default_inputrc  : C:\Program Files (x86)\clink\default_inputrc
inputrc          : %clink_inputrc%
                     (unset)
                 : state directory
                     C:\Users\pluto\AppData\Local\clink\.inputrc
                     C:\Users\pluto\AppData\Local\clink\_inputrc
                 : %userprofile%
                     C:\Users\pluto\.inputrc   (LOAD)
                     C:\Users\pluto\_inputrc
                 : %localappdata%
                     C:\Users\pluto\AppData\Local\.inputrc
                     C:\Users\pluto\AppData\Local\_inputrc
                 : %appdata%
                     C:\Users\pluto\AppData\Roaming\.inputrc
                     C:\Users\pluto\AppData\Roaming\_inputrc
                 : %home%
                     C:\Users\pluto\.inputrc   (exists)
                     C:\Users\pluto\_inputrc
system           : 10.0.19045.5011
codepage         : 1252
keyboard langid  : 1033
keyboard layout  : 00004009

(manually added themes dir)

22:53:26|C:\Windows\system32>ls "C:\Program Files (x86)\clink\themes"
agnoster.clinkprompt  darkblood.clinkprompt         Headline.clinkprompt    Plain.clinktheme           Solarized Light.clinktheme        Tomorrow Night Eighties.clinktheme
Antares.clinkprompt   Dracula.clinktheme            jonathan.clinkprompt    pure.clinkprompt           Tomorrow Night Blue.clinktheme    Tomorrow Night.clinktheme
bureau.clinkprompt    Enhanced Defaults.clinktheme  oh-my-posh.clinkprompt  Solarized Dark.clinktheme  Tomorrow Night Bright.clinktheme  Tomorrow.clinktheme
22:55:02|C:\Windows\system32>cat C:\Users\pluto\AppData\Local\clink\clink.log
7f28 app_context::start_logger  483 ---- 2024/10/20 14:38:49.789 -------------------------------------------------
7f28 app_context::start_logger  486 Host process is 'cmd.exe' (pid 32552)
7f28 app_context::start_logger  490 DLL path is 'C:\Program Files (x86)\clink'
7f28 app_context::start_logger  493 DLL base is 00007FFC37760000
7f28 app_context::start_logger  508 Windows version 10.0.19045 (x64)
7f28 app_context::start_logger  510 Clink version 1.7.3.f8fb96 (x64)
7f28 hook_setter::hook_setter  159 >>> Started hook transaction.
7f28 hook_setter::attach_iat   316 Attempting to hook SetEnvironmentVariableW in IAT for module 00007FF785B20000.
7f28 pe_info::iterate_imports  195 Found import in 'api-ms-win-core-processenvironment-l1-1-0.dll'
7f28 find_iat                  124 Found import at 00007FF785B53860 (value is 00007FFC6D7C28A0).
7f28 hook_setter::attach_iat   316 Attempting to hook SetEnvironmentStringsW in IAT for module 00007FF785B20000.
7f28 pe_info::iterate_imports  195 Found import in 'api-ms-win-core-processenvironment-l1-1-0.dll'
7f28 find_iat                  124 Found import at 00007FF785B53888 (value is 00007FFC6D7BD170).
7f28 hook_setter::attach_iat   316 Attempting to hook WriteConsoleW in IAT for module 00007FF785B20000.
7f28 pe_info::iterate_imports  195 Found import in 'api-ms-win-core-console-l1-1-0.dll'
7f28 find_iat                  124 Found import at 00007FF785B534F8 (value is 00007FFC6D7A9D20).
7f28 hook_setter::attach_iat   316 Attempting to hook GetEnvironmentVariableW in IAT for module 00007FF785B20000.
7f28 pe_info::iterate_imports  195 Found import in 'api-ms-win-core-processenvironment-l1-1-0.dll'
7f28 find_iat                  124 Found import at 00007FF785B53880 (value is 00007FFC6D782390).
7f28 hook_setter::commit       207 <<< Hook transaction committed.
7f28 hook_setter::hook_setter  159 >>> Started hook transaction.
7f28 hook_setter::detach_iat   359 Attempting to unhook 00007FFC377860D0 from GetEnvironmentVariableW in IAT for module 00007FF785B20000.
7f28 pe_info::iterate_imports  195 Found import in 'api-ms-win-core-processenvironment-l1-1-0.dll'
7f28 find_iat                  124 Found import at 00007FF785B53880 (value is 00007FFC377860D0).
7f28 hook_setter::commit       207 <<< Hook transaction committed.
7f28 hook_setter::hook_setter  159 >>> Started hook transaction.
7f28 hook_setter::attach_iat   316 Attempting to hook ReadConsoleW in IAT for module 00007FF785B20000.
7f28 pe_info::iterate_imports  195 Found import in 'api-ms-win-core-console-l1-1-0.dll'
7f28 find_iat                  124 Found import at 00007FF785B534E0 (value is 00007FFC6D876CF0).
7f28 hook_setter::commit       207 <<< Hook transaction committed.
7f28 hook_setter::hook_setter  159 >>> Started hook transaction.
7f28 hook_setter::attach_iat   316 Attempting to hook SetConsoleTitleW in IAT for module 00007FF785B20000.
7f28 pe_info::iterate_imports  195 Found import in 'api-ms-win-core-console-l2-2-0.dll'
7f28 find_iat                  124 Found import at 00007FF785B53558 (value is 00007FFC6D7A5EC0).
7f28 hook_setter::commit       207 <<< Hook transaction committed.
7f28 win_screen_buffer::begin  392 Using native terminal support (auto mode found 'WindowsTerminal.exe').
7f28 load_user_inputrc        1717 Found Readline inputrc at 'C:\Users\pluto\.inputrc'
7f28 host_lua::load_scripts    199 Loaded 20 Lua scripts in 84 ms
7f28 @~clink~/app/update.lua   423 Clink updater: too soon to check for updates (1729414951 vs 1729415329).
7f28 history_db::initialise   1328 master bank ctag: |CTAG_1706371674_221634781_32468_0
7f28 history_db::compact      1606 History:  11152 active, 24963 deleted
7f28 history_db::compact      1606 History:  11151 active, 24964 deleted
7f28 history_db::compact      1606 History:  11149 active, 24966 deleted
7f28 history_db::compact      1606 History:  11148 active, 24967 deleted
7b20 history_db::compact      1606 History:  11152 active, 24963 deleted
9b70 @~clink~/app/update.lua   487 Clink updater: latest release is v1.7.3; install type is zip.
9b70 @~clink~/app/update.lua   638 Clink updater: no update available; local version v1.7.3 is not older than latest release v1.7.3.
7f28 history_db::compact      1606 History:  11147 active, 24968 deleted
7f28 history_db::compact      1606 History:  11147 active, 24968 deleted
7f28 history_db::compact      1606 History:  11147 active, 24968 deleted
7f28 history_db::compact      1606 History:  11147 active, 24968 deleted
7f28 history_db::compact      1606 History:  11147 active, 24968 deleted
7f28 history_db::compact      1606 History:  11147 active, 24968 deleted

@chrisant996
Copy link
Owner Author

chrisant996 commented Oct 22, 2024

@plutonium-239 Thanks for sharing the info; that made the problem clear.

You overrode the scripts directories, and you removed the Clink program directory from the list of script directories.

scripts          : d:\dead\clink_lua_scripts\;d:\dead\clink-gizmos\;d:\dead\clink-completions\

That's why Clink can't find the themes directory -- Clink is behaving exactly according to the documentation here. You removed the Clink program directory from the list of script directories, and that blocks Clink from finding the themes directory under the Clink program directory (as point 2 says).

I'll make a change to forcibly look under the Clink program directory even when a user has told Clink not to look there (but I'll only force it for *.clinktheme and *.clinkprompt files, not for *.lua files).

In the meantime, please consider adding the Clink program directory back into the list of allowed script directories. Or add the Clink program directory into the CLINK_THEMES_DIR environment variable.

@chrisant996 chrisant996 added the external The issue is due to external causes outside of Clink label Oct 22, 2024
@plutonium-239
Copy link

Thanks a lot, it works now! (I added to clink.path)

Should I close this issue or do you want to track the changes you mentioned above here?

@chrisant996
Copy link
Owner Author

Thanks a lot, it works now! (I added to clink.path)

Great, thanks for the confirmation.

Should I close this issue or do you want to track the changes you mentioned above here?

The changes are already committed, so I'll close this.

Thanks for reporting the issue, and for collecting troubleshooting info. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external The issue is due to external causes outside of Clink
Projects
None yet
Development

No branches or pull requests

2 participants