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

"Error: accepts 1 arg(s), received 2" on strings with spaces using Clink #2414

Closed
1 task done
NotSpaulding opened this issue Jun 17, 2022 · 3 comments · Fixed by #2416
Closed
1 task done

"Error: accepts 1 arg(s), received 2" on strings with spaces using Clink #2414

NotSpaulding opened this issue Jun 17, 2022 · 3 comments · Fixed by #2416
Assignees
Labels
🐛 bug Something isn't working

Comments

@NotSpaulding
Copy link

Code of Conduct

  • I agree to follow this project's Code of Conduct

What happened?

Whenever Oh My Posh detects a string with spaces in it while using Clink, it just has a stroke.
Example

Theme

Happens with any theme.

What OS are you seeing the problem on?

Windows

Which shell are you using?

other (please specify)

Log output

Version: 8.5.0

Segments:

ConsoleTitle(false) -   0 ms -
session(true)  -   0 ms -  user@laptop 
path(true)     -   1 ms -  ~
shell(true)    -   0 ms -  oh-my-posh
text(true)     -   0 ms -  no config
exit(true)     -  13 ms -   

Run duration: 66.2554ms

Cache path: C:\Users\user\AppData\Local\oh-my-posh

Config path: C:\Users\user\"D:\Scoop\persist\oh-my-posh\themes\pararussel.omp.json"

Logs:

2022/06/17 14:25:03 debug: Getenv
C:\Users\user\AppData\Local
2022/06/17 14:25:03 Getenv duration: 19.5004ms, args: LOCALAPPDATA
2022/06/17 14:25:03 CachePath duration: 27.2405ms, args:
2022/06/17 14:25:03 debug: Getenv
"D:\Scoop\persist\oh-my-posh\themes\pararussel.omp.json"
2022/06/17 14:25:03 Getenv duration: 0s, args: POSH_THEME
2022/06/17 14:25:03 Shell duration: 19.5144ms, args:
2022/06/17 14:25:03 resolveConfigPath duration: 19.5144ms, args:
2022/06/17 14:25:03 Init duration: 46.7549ms, args:
2022/06/17 14:25:03 Flags duration: 0s, args:
2022/06/17 14:25:03 config.loadConfig duration: 501.7µs, args:
2022/06/17 14:25:03 Flags duration: 0s, args:
2022/06/17 14:25:03 debug: Getenv

2022/06/17 14:25:03 Getenv duration: 0s, args: OMP_CACHE_DISABLED
2022/06/17 14:25:03 WindowsRegistryKeyValue duration: 0s, args: HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\ColorizationColor
2022/06/17 14:25:03 PathSeparator duration: 0s, args:
2022/06/17 14:25:03 PathSeparator duration: 0s, args:
2022/06/17 14:25:03 PathSeparator duration: 0s, args:
2022/06/17 14:25:03 PathSeparator duration: 0s, args:
2022/06/17 14:25:03 PathSeparator duration: 0s, args:
2022/06/17 14:25:03 PathSeparator duration: 0s, args:
2022/06/17 14:25:03 PathSeparator duration: 0s, args:
2022/06/17 14:25:03 PathSeparator duration: 0s, args:
2022/06/17 14:25:03 PathSeparator duration: 0s, args:
2022/06/17 14:25:03 PathSeparator duration: 0s, args:
2022/06/17 14:25:03 PathSeparator duration: 0s, args:
2022/06/17 14:25:03 PathSeparator duration: 0s, args:
2022/06/17 14:25:03 PathSeparator duration: 0s, args:
2022/06/17 14:25:03 PathSeparator duration: 0s, args:
2022/06/17 14:25:03 PathSeparator duration: 0s, args:
2022/06/17 14:25:03 PathSeparator duration: 0s, args:
2022/06/17 14:25:03 PathSeparator duration: 0s, args:
2022/06/17 14:25:03 PathSeparator duration: 0s, args:
2022/06/17 14:25:03 PathSeparator duration: 0s, args:
2022/06/17 14:25:03 debug: WindowsRegistryKeyValue
ColorizationColor(DWORD): 0xC40078D7
2022/06/17 14:25:03 Root duration: 0s, args:
2022/06/17 14:25:03 Shell duration: 0s, args:
2022/06/17 14:25:03 ErrorCode duration: 0s, args:
2022/06/17 14:25:03 IsWsl duration: 0s, args:
2022/06/17 14:25:03 debug: Pwd
C:\Users\user
2022/06/17 14:25:03 Pwd duration: 0s, args:
2022/06/17 14:25:03 debug: Home
C:\Users\user
2022/06/17 14:25:03 PathSeparator duration: 0s, args:
2022/06/17 14:25:03 PathSeparator duration: 0s, args:
2022/06/17 14:25:03 debug: User
user
2022/06/17 14:25:03 User duration: 0s, args:
2022/06/17 14:25:03 debug: Host
DESKTOP-6LCCH7L
2022/06/17 14:25:03 Host duration: 0s, args:
2022/06/17 14:25:03 GOOS duration: 0s, args:
2022/06/17 14:25:03 TemplateCache duration: 0s, args:
2022/06/17 14:25:03 Flags duration: 0s, args:
2022/06/17 14:25:03 debug: Pwd
C:\Users\user
2022/06/17 14:25:03 Pwd duration: 0s, args:
2022/06/17 14:25:03 debug: Home
C:\Users\user
2022/06/17 14:25:03 GOOS duration: 0s, args:
2022/06/17 14:25:03 debug: Getenv

2022/06/17 14:25:03 Getenv duration: 0s, args: SSH_CONNECTION
2022/06/17 14:25:03 debug: Getenv

2022/06/17 14:25:03 Getenv duration: 0s, args: SSH_CLIENT
2022/06/17 14:25:03 TemplateCache duration: 0s, args:
2022/06/17 14:25:03 TemplateCache duration: 0s, args:
2022/06/17 14:25:03 Shell duration: 0s, args:
2022/06/17 14:25:03 debug: Pwd
C:\Users\user
2022/06/17 14:25:03 Pwd duration: 500µs, args:
2022/06/17 14:25:03 debug: Home
C:\Users\user
2022/06/17 14:25:03 GOOS duration: 0s, args:
2022/06/17 14:25:03 debug: Pwd
C:\Users\user
2022/06/17 14:25:03 Pwd duration: 0s, args:
2022/06/17 14:25:03 Flags duration: 0s, args:
2022/06/17 14:25:03 debug: Pwd
C:\Users\user
2022/06/17 14:25:03 Pwd duration: 0s, args:
2022/06/17 14:25:03 debug: Home
C:\Users\user
2022/06/17 14:25:03 GOOS duration: 0s, args:
2022/06/17 14:25:03 GOOS duration: 0s, args:
2022/06/17 14:25:03 PathSeparator duration: 0s, args:
2022/06/17 14:25:03 PathSeparator duration: 0s, args:
2022/06/17 14:25:03 PathSeparator duration: 0s, args:
2022/06/17 14:25:03 PathSeparator duration: 0s, args:
2022/06/17 14:25:03 GOOS duration: 0s, args:
2022/06/17 14:25:03 IsWsl duration: 0s, args:
2022/06/17 14:25:03 StackCount duration: 0s, args:
2022/06/17 14:25:03 DirIsWritable duration: 0s, args:
2022/06/17 14:25:03 TemplateCache duration: 0s, args:
2022/06/17 14:25:03 TemplateCache duration: 0s, args:
2022/06/17 14:25:03 Shell duration: 0s, args:
2022/06/17 14:25:03 debug: Pwd
C:\Users\user
2022/06/17 14:25:03 Pwd duration: 0s, args:
2022/06/17 14:25:03 debug: Home
C:\Users\user
2022/06/17 14:25:03 GOOS duration: 0s, args:
2022/06/17 14:25:03 Shell duration: 0s, args:
2022/06/17 14:25:03 Flags duration: 0s, args:
2022/06/17 14:25:03 TemplateCache duration: 0s, args:
2022/06/17 14:25:03 TemplateCache duration: 0s, args:
2022/06/17 14:25:03 Shell duration: 0s, args:
2022/06/17 14:25:03 debug: Pwd
C:\Users\user
2022/06/17 14:25:03 Pwd duration: 0s, args:
2022/06/17 14:25:03 debug: Home
C:\Users\user
2022/06/17 14:25:03 GOOS duration: 0s, args:
2022/06/17 14:25:03 TemplateCache duration: 0s, args:
2022/06/17 14:25:03 TemplateCache duration: 0s, args:
2022/06/17 14:25:03 Shell duration: 0s, args:
2022/06/17 14:25:03 debug: Pwd
C:\Users\user
2022/06/17 14:25:03 Pwd duration: 0s, args:
2022/06/17 14:25:03 debug: Home
C:\Users\user
2022/06/17 14:25:03 GOOS duration: 0s, args:
2022/06/17 14:25:03 ErrorCode duration: 0s, args:
2022/06/17 14:25:03 TemplateCache duration: 0s, args:
2022/06/17 14:25:03 TemplateCache duration: 0s, args:
2022/06/17 14:25:03 Shell duration: 0s, args:
2022/06/17 14:25:03 TemplateCache duration: 0s, args:
2022/06/17 14:25:03 debug: Getenv
C:\Users\user\AppData\Local
2022/06/17 14:25:03 Getenv duration: 0s, args: LOCALAPPDATA
2022/06/17 14:25:03 CachePath duration: 0s, args:
2022/06/17 14:25:03 Flags duration: 0s, args:
@NotSpaulding NotSpaulding added the 🐛 bug Something isn't working label Jun 17, 2022
@lewis-yeung
Copy link
Contributor

This can be related to a recent change on tooltip behaviors. A double quote character (") in command is not properly escaped here.

local prompt_exe = string.format('%s print tooltip --shell=cmd --config=%s --command="%s"', omp_exe(), omp_config(), command)

I have just tested a patch of simply escaping quotes and it fixes the bug. However I have to make further tests to ensure it will not introduce new weird bugs. 😅

@lewis-yeung
Copy link
Contributor

lewis-yeung commented Jun 17, 2022

It should work as expected after the fix is live. :)

bug-fixed

Copy link

This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues.
If you have found a problem that seems similar, please open a discussion first, complete the body with all the details necessary to reproduce, and mention this issue as reference.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants