You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a script developed in python that may output a large amount of content.
It works normally on Xbar. When I switch to SwiftBar, I find that the program always displays three points as placeholders at startup.
When I check the process(ps -ef | grep *.py), I found that the script was running, but when I use run in Terminal..., it quickly produce output.
By manually interrupting the script, I get an error message on the status bar. The content of the message is what I originally wanted to output, but it is only 64KB long.
To Reproduce
Run any script that produces more than 64KB of content.
Expected behavior
Output longer content
Screenshots
Environment:
macOS version: 12.3
SwiftBar version: 1.4.3 (422)
Plugin Example:
#!/usr/bin/env /usr/bin/python3# every menu item got 1KB sizeLARGE_DATA="*"*(1024-len("content 00 | extra="))
print("Long Content")
print("---")
# after changing 64 to 63, the problem disappearsforiinrange(64):
print(f"content {i:0>2} | extra={LARGE_DATA}")
Additional Context:
I don't run Bartender/Dozer/etc. or tested the issue without it running
I guess the problem is that the default buffer size is only 64KB. When the output content is too large, the program will get stuck at line 82, so I adjusted the above code(line 82 to 85) to:
Hey @xfangfang, thank you, your assesment is correct, I've got to this point as well when was researching #294
The problem is I couldn't find any buffer configuration options, yet.
so I adjusted the above code(line 82 to 85)
This is an interesting idea, I was editing this code so much and got a little blindspoted, thank you for suggestion, I'll test.
Describe the bug
I have a script developed in python that may output a large amount of content.
It works normally on Xbar. When I switch to SwiftBar, I find that the program always displays three points as placeholders at startup.
When I check the process(
ps -ef | grep *.py
), I found that the script was running, but when I userun in Terminal...
, it quickly produce output.By manually interrupting the script, I get an error message on the status bar. The content of the message is what I originally wanted to output, but it is only 64KB long.
To Reproduce
Run any script that produces more than 64KB of content.
Expected behavior
Output longer content
Screenshots
Environment:
Plugin Example:
Additional Context:
SwiftBar/SwiftBar/Utility/RunScript.swift
Lines 73 to 86 in 4dbe224
I guess the problem is that the default buffer size is only 64KB. When the output content is too large, the program will get stuck at line 82, so I adjusted the above code(line 82 to 85) to:
Then the program can run normally.
Ralated issue: #294
The text was updated successfully, but these errors were encountered: