Zsh (Wsl) can not response when cd command into the specified directory - zsh

I have the problem about zsh (wsl) in windows 11, when I cd into the specified directory, only that folder, my zsh doesn't response, and I have to ctrl+c every time I want to type the next command. I don't know what this problem is, and how to fix this. My PowerShell still works normally, only zsh encounters this error. Anyone can help me pls?
I try waiting some minutes and this evently responses, this folder is my repo git in windows, i use zsh to cd into this, and it takes me quite lots of time to enter this folder. How to fix this problem?

I found out in many webs to look for any solution to fix or improve this problem, and i evently also found 2 ways for this.
First, change the line "disable_untracked_files_dirty" into true in your .zshrc file.
Second, if you're using powerlevel10k, add this line "typeset -g POWERLEVEL9K_INSTANT_PROMPT=quiet" into the .p10k.zsh file if you're using this file to config your powerlevel10k, or add this line "POWERLEVEL9K_INSTANT_PROMPT=quiet" into your .zshrc file if you're using .zshrc to config your powerlevel10k.
Hope to help

Related

No such directory or file - Mac

I'm pretty rookie to this, but I managed to get this code running when I had a PC.
Now I want to get this working on my MacBook.
I'm using Rclone to sync to Jottacloud, and I want to make a clickable file, just as a .bat file in windows.
This is my simple code:
#!/bin/bash
cd /
cd /Applications/rclone
rclone copy /Users/windsvendsen/Pictures/Billedebank Jottacloud:Billedebank
Running it in Terminal, without the #!/bin/bash, it works as it should.
But when I save it as a file, without extension, and running chmod 744 on it, it returns with the error "No such file directory"
And here does my knowledge end.
It is probably a pretty simple problem, but I do not manage to get the essence out of my google searches.
Thanks in advance!
Can you do ls on the directory and see if the file actually got created

grpcui: command not found

I am new to grpcui. I've been trying to follow the installation. I did
go get github.com/fullstorydev/grpcui/...
go install github.com/fullstorydev/grpcui/cmd/grpcui
I also added grpcui path to my $PATH. Even tried to pull down the repo and make install. But I keep getting grpcui: command not found. Anyone could help ?
After installation, your grpcui should be in /home/user/go/bin. If so, try and add that folder to your $PATH, as I did (and it worked).
To further Adam's answer, a critical step in updating the PATH is restarting the terminal.
On OSX this needs to be done via exec bash -l. Simply exiting and opening the terminal does not work.
path gist
terminal SO question

After restart ZSH cannot find NPM, Gulp or Bower

Context
Earlier this week, while my computer was starting Ubuntu 17.10 it shutoff due to low battery.
The Problem
Upon plugging in and rebooting I noticed some unusual behavior. One of the key things was that Oh My ZSH appears to be broken. Meaning, when I opened Terminal, pressed the up arrow to cycle through my history, and hit enter to execute the command: it reported it could not find my ZSH history log and failed to execute the command.
What I've Tried
So I assumed that ZSH was corrupted as a consequence of the improper shut down. So I reinstalled and the history error disappeared. But then it couldn't find NPM, Gulp or Bower. Meaning, when I executed something like gulp watch it reports zsh: command not found: gulp.
So I attempted to reinstall gulp with NPM and it reported the same error but for NPM.
I concluded that they were still installed and not corrupted but that ZSH simply can't find them.
So I tried a random command to export "paths" from a bash file to my ZSH file (I think they're called .rc files but I don't remember).
Then it seems to work.
Then I closed Terminal and it stopped working.
So I reinstalled ZSH again, this time using apt-get and it worked without having to export my paths.
Then I restarted (properly) and discovered it's broken again.
The Question
Can anyone explain why this is happening and how to resolve it?
short answer: add path in your ~/.zshrc
tl;dr
find executable path for your libraries or programs and add them
nano ~/.zshrc
export PATH=/path/to/lib/or/bin:$PATH
then save the file (ctl+o)
after this restart your zsh or reload the rc file (source ~/.zshrc)

Rstudio Git bash pop-up every time

I have integrated the git version control to an existing project in Rstudio(Windows). After that for every change I make in the Rmd file, a pop up is coming. I could see that it is a git bash executing on every command I have added in the file. I do not have more details on this.
Actually solved it myself just now with the help of this info:
https://stat545-ubc.github.io/git03_rstudio-meet-git.html
WARNING: On Windows, do NOT use C:/Program Files (x86)/Git/cmd/git.exe. The difference between the good and bad paths is bin vs. cmd.
My Rstudio-version was setting the cmd/git.exe as default.
If you change that to bin/git.exe my problem was solved...

Zsh wants to autocorrect a command, with an _ before it

I just started using Zsh lately for some of the integrated support in the shell prompt for my Git status etc.
When I type in:
ruby -v
to confirm the version of ruby I'm running, Zsh asks if I want to change the command to _ruby. Well after saying no at the prompt and the command completing as expected I continue to get the question at the prompt after confirming my command is correct.
I'm assuming there is a completion file or something of the sort.
Thanks
Update:
The shell is no longer trying to complete _ruby, it stopped responding after closing the shell a few times some how.
I tried to clean the file up several times but there is a "opts" variable that is 50 or more lines long and the lines are all ran together, some lines more than 150 characters. Maybe I could email an attachment to you if you still want to see it.
I sincerely apologize for the messy post.
This is command autocorrection, activated by the correct option. It has nothing to do with completion. You're seeing _ruby because zsh thinks there is no ruby command and it offers _ruby as the nearest existing match.
If you've just installed ruby, it's possible that zsh has memorized the list of available command earlier, and it won't always try to see if the command has appeared in between. In that case, run hash -rf. Future zsh sessions won't have this problem since the ruby command already existed when they started.
Sometimes, when you change your PATH, zsh forgets some hashed commands. The option hash_listall helps against this. As above, if you can force zsh to refresh its command cache with hash -rf.
You could make an alias:
alias ruby='nocorrect ruby'
It's what I did when zsh kept asking me if I meant .meteor when I typed meteor because auto-correct is still useful from time to time.
I find the autocorrect feature can get annoying at times. So I do in my ~/.zshrc,
DISABLE_CORRECTION="true"
I had the same problem even when the command is not installed.
I can solve it using the CORRECT_IGNORE variable in my .zshrc
# OPTs to enable
setopt HASH_LIST_ALL
setopt CORRECT
# Zsh variable to determine what to ignore,
# in this case everything starting with _ or .
CORRECT_IGNORE="[_|.]*"
I hope it helps to you or anyone with this issue
Sometime ago after an update, I got command auto-correction enabled which I don't want. If the same happened to you and you want to revert it, in the ~/.zshrc file you'll have make it:
# Uncomment the following line to enable command auto-correction.
ENABLE_CORRECTION="false"
or comment it as per bellow:
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
Just a note, on my zsh (version 5.7.1 on macOS), the DISABLE_CORRECTION didn't work.
I saw in my .zshrc file the following two lines, which I then commented out
setopt CORRECT
setopt CORRECT_ALL
That did it for me.

Resources