-
Notifications
You must be signed in to change notification settings - Fork 19
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
Synth shell is a bit slow in Windows WSL #35
Comments
Usually the slow bit is because it tries to get its public IP but cant
reach anyone to get this info. Can you confirm that the slow response only
happens if you have no internet? In either case, you can go to config and
remove the PUBLIC_IPV4 (i think it was called something like that) and see
if it helps. Please report back and we'll take it from there :)
…On Thu, Dec 14, 2023 at 12:03 PM vinrepos ***@***.***> wrote:
Hi so I've managed to make synth shell look exactly how I wanted but I
just found it to be a bit slow. Sometimes it takes like half-a-second to
load the output. Is there any way to speed it up? I've also attached a
video recording of my terminal.
https://github.com/andresgongora/synth-shell-prompt/assets/104124987/034069f3-d263-49ae-b5e0-20403f9a9aed
—
Reply to this email directly, view it on GitHub
<#35>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC36INWMMKGTEAVOFJ7EWY3YJLMJJAVCNFSM6AAAAABAUUX426VHI2DSMVQWIX3LMV43ASLTON2WKOZSGA2DCNBWGI4TQNQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Hey I do have internet connectivity on my host machine and the wsl. And I also tested the commands without the internet. Both times the responses were slow. And I couldn't find any IP address related lines in the synth shell config files anywhere. Could you let me know where exactly it would be, please? Thanks |
Sure! Under .config/synth-shell/synth-shell-greeter.config (the exact path
to the config path is probably is probably a bit weird for WSL, I don't use
it, so I can't tell). Once you are in the config file, search for the line
`print_info="`. Under it you will see a list of all the elements that get
printed when you open a terminal. One of these elements is `EXTERNALIPV4`.
Simply remove the line that contains it and try to open a terminal. You'll
see that there is now one element less in the greeting message; you will
have removed your external IPv4 from the list. I'd bet this is the element
that makes your machine slightly slower since it's the only one that has to
"communicate" to the outside world (it gets the IP from Google, I believe,
we wrote this a looong time ago). Let me know if it worked :)
…On Thu, Dec 14, 2023 at 11:34 PM vinrepos ***@***.***> wrote:
Hey I do have internet connectivity on my host machine and the wsl.
And I couldn't find any IP address related lines in the synth shell config
files anywhere. Could you let me know where exactly it would be, please?
Thanks
vin
—
Reply to this email directly, view it on GitHub
<#35 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC36INQGTMVLASOZ6Y7QIQ3YJN5FTAVCNFSM6AAAAABAUUX426VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJWHAZDEOBXGE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Ahh I see, you only installed the prompt!! My bad. I'm used to people
installing the whole synt-shell package.
In that case... I fear I dont know what could be introducing that extra
delay.
When you disable synth-shell-prompt from your terminal, does the lag go
away?
…On Fri, Dec 15, 2023 at 8:26 AM vinrepos ***@***.***> wrote:
Hi thanks, but I don't have a synth-shell-greeter.config file. Have a look
at the screenshot below, please.
image.png (view on web)
<https://github.com/andresgongora/synth-shell-prompt/assets/104124987/9b49eb1a-25dc-41dd-825d-ead131bf60bb>
—
Reply to this email directly, view it on GitHub
<#35 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC36INROUPJQABFVWI4BQJTYJP3THAVCNFSM6AAAAABAUUX426VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJXGQYDCMRSGA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Yeah I'm using only the synth shell prompt. I just tried uninstalling it and I'm back on the default shell and it is pretty fast. Anyway, i reckon it's a known issue with WSL. I have tried a few things from a few other relevant threads but hasn't really helped improve the terminal output speed. |
Maybe you can disable all other features in the prompt, like git and python
support. They check for special files/env-variables that might be
problematic on Windows
…On Fri, Dec 15, 2023 at 9:09 AM vinrepos ***@***.***> wrote:
Yeah I'm using only the synth shell prompt. I just tried uninstalling it
and I'm back on the default shell and it is pretty fast.
Anyway, i reckon it's a known issue with WSL. I have tried a few things
from a few other relevant threads but hasn't really helped improve the
terminal output speed.
—
Reply to this email directly, view it on GitHub
<#35 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC36INQRIXLF4FBTETCCW33YJQAUDAVCNFSM6AAAAABAUUX426VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJXGQ2TENRUGA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Yeah I have tried that too, hasn't worked either. I think WSL sucks haha, I'm gonna go back to using a proper VM. Thanks for your help so far anyway. |
Sure! Let's hope someone finds a solution to this eventually :)
…On Fri, Dec 15, 2023 at 9:28 AM vinrepos ***@***.***> wrote:
Yeah I have tried that too, hasn't worked either. I think WSL sucks haha,
I'm gonna go back to using a proper VM. Thanks for your help so far anyway.
—
Reply to this email directly, view it on GitHub
<#35 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC36INUWC2G6FLDVFT5ATH3YJQC4PAVCNFSM6AAAAABAUUX426VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJXGQ3TMMJZGY>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Hi @vinrepos, I had the same issue with WSL being slow processing the prompt. Then I found this: https://yalneb.blogspot.com/2018/01/fancy-bash-promt.html It seems that the script is much more simpler and doesn't add advanced features like git or python environment, but it suit my purpose. I'm guessing the script is an early version of the synth-shell-prompt. The only drawback is, it is slightly more difficult to configure, since you need to read the script and find the exact variable to change, and no fancy git feature that I actually love. Good thing is there is no delay at all when displaying the prompt. |
Hmmm if it's because of git or pyenvs, maybe you could try the new one and
disable all extra features from within the config
…On Sun, Aug 4, 2024 at 6:23 PM Danny Kurniawan ***@***.***> wrote:
Hi @vinrepos <https://github.com/vinrepos>, I had the same issue with WSL
being slow processing the prompt. Then I found this:
https://yalneb.blogspot.com/2018/01/fancy-bash-promt.html
It seems that the script is much more simpler and doesn't add advanced
features like git or python environment, but it suit my purpose. I'm
guessing the script is an early version of the synth-shell-prompt.
The only drawback is, it is slightly more difficult to configure, since
you need to read the script and find the exact variable to change, and no
fancy git feature that I actually love. Good thing is there is no delay at
all when displaying the prompt.
—
Reply to this email directly, view it on GitHub
<#35 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC36INQ2SUCIFDFCWXQKHTTZPZIRPAVCNFSM6AAAAABL663SVWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRXGU4TMNJRHA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Hi @andresgongora, first I disable all extra environments from config file as follows: format="USER HOST PWD" But it's still slow, so I try to disable the actual codes from ...
prompt_command_hook()
{
## GET PARAMETERS
## This might be a bit redundant, but it makes it easier to maintain
local elements=(${SSP_ELEMENTS[@]})
local user=$USER
local host=$HOSTNAME
local path="$(shortenPath "$PWD" $SSP_MAX_PWD_CHAR $SSP_PWD_TRUNC_SYMBOL)" # bash-tools::shortenPath
#local git_branch="$(getGitBranch)"
#local pyenv="$(getPyenv)"
#local kube="$(getKube)"
#local tf="$(getTerraform)"
local clock="$(date +"${SSP_CLOCK_FORMAT}")"
## ADAPT DYNAMICALLY ELEMENTS TO BE SHOWN
## Check if elements such as GIT and the Python environment should be
## shown and adapt the variables as needed. This usually implies removing
## the appropriate field from the "elements" array if the user set them
#if [ -z "$git_branch" ]; then
# elements=( ${elements[@]/"GIT"} ) # Remove GIT from elements to be shown
#fi
#if [ -z "$pyenv" ]; then
# elements=( ${elements[@]/"PYENV"} ) # Remove PYENV from elements to be shown
#fi
#if [ -z "$tf" ]; then
# elements=( ${elements[@]/"TF"} ) # Remove TF from elements to be shown
#fi
#if [ -z "$kube" ]; then
# elements=( ${elements[@]/"KUBE"} ) # Remove KUBE from elements to be shown
#fi
... The delay slightly better, but still there... |
I fear I don't have access to Windows to test this. Can you try to further
comment/isolate bits of the script. Once the culprit is identified we could
quickly fix it for everyone :)
…On Mon, Aug 5, 2024 at 4:38 AM Danny Kurniawan ***@***.***> wrote:
Hi @andresgongora <https://github.com/andresgongora>, first I disable all
extra environments from config file as follows:
format="USER HOST PWD"
But it's still slow, so I try to disable the actual codes from
synth-shell-prompt.sh as well:
... prompt_command_hook() { ## GET PARAMETERS ## This might be a bit
redundant, but it makes it easier to maintain local
elements=(${SSP_ELEMENTS[@]}) local user=$USER local host=$HOSTNAME local
path="$(shortenPath "$PWD" $SSP_MAX_PWD_CHAR $SSP_PWD_TRUNC_SYMBOL)" #
bash-tools::shortenPath #local git_branch="$(getGitBranch)" #local
pyenv="$(getPyenv)" #local kube="$(getKube)" #local tf="$(getTerraform)"
local clock="$(date +"${SSP_CLOCK_FORMAT}")" ## ADAPT DYNAMICALLY ELEMENTS
TO BE SHOWN ## Check if elements such as GIT and the Python environment
should be ## shown and adapt the variables as needed. This usually implies
removing ## the appropriate field from the "elements" array if the user set
them #if [ -z "$git_branch" ]; then # elements=( ${elements[@]/"GIT"} ) #
Remove GIT from elements to be shown #fi #if [ -z "$pyenv" ]; then #
elements=( ${elements[@]/"PYENV"} ) # Remove PYENV from elements to be
shown #fi #if [ -z "$tf" ]; then # elements=( ${elements[@]/"TF"} ) #
Remove TF from elements to be shown #fi #if [ -z "$kube" ]; then #
elements=( ${elements[@]/"KUBE"} ) # Remove KUBE from elements to be shown
#fi ...
The delay slightly better, but still there...
—
Reply to this email directly, view it on GitHub
<#35 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC36INVYNKERHIWKEKTO6LLZP3QQPAVCNFSM6AAAAABL663SVWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRYGA3DEMZXGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@andresgongora, I tried to modify here's my modified script: synt-shell-prompt_debug.tar.gz When I ran it, seems total time closing to 1.7 seconds (including profiling stuffs I think), but I think we can check how much time spent for each line of the codes from the log. The configuration still same, I only change the following line in synth-shell-prompt.config:
|
Hi so I've managed to make synth shell look exactly how I wanted but I just found it to be a bit slow. Sometimes it takes like half-a-second to load the output. Is there any way to speed it up? I've also attached a video recording of my terminal.
Awesome-Screen-Recorder-Screenshot.mp4
The text was updated successfully, but these errors were encountered: