Questions tagged [zsh]

Zsh or Z Shell is the default Unix shell used by Terminal in macOS since 10.15

Filter by
Sorted by
Tagged with
2
votes
2answers
100 views

MacOS Catalina terminal tab doesn't remember its own previous commands

I upgraded from El Capitan to Catalina recently; when I click ↑ in any terminal tab it used to toggle previous commands executed within that specific tab only, but now it will show commands for all ...
1
vote
5answers
358 views

How to identify the largest files in a directory including in its subdirectories?

I have a directory with a lot of files and subdirectories. I know there are a small number of large files contained somewhere within. What is a quick/easy way to identify one or more large files in a ...
1
vote
2answers
44 views

grep ^\. not working as expected in Mac terminal

if I run the following command in my mac terminal: ls -al | grep ^\. or ls -al | grep '^\.' or ls -al | grep "^\." I get no results back even though there are several files in my home ...
0
votes
1answer
23 views

Launchd/Launchctl - pre and post scripting

Is there any way with ld/lctrl to execute pre/post commands similar to systemd's ExecStartPre/ ExecStopPost?
1
vote
1answer
44 views

zsh can't see and doesn't load the ~/.zshrc startup file

After upgrading to Catalina and encountering the zsh upgrade reminder when launching Terminal, I've decided to switch to zsh. The default interactive shell is now zsh. To update your account to use ...
0
votes
1answer
72 views

zsh-autosuggestions: How to install zpty module?

I love zsh-autosuggestions and found in the README: completion: Chooses a suggestion based on what tab-completion would suggest. (requires zpty module) With a web search I din't find out what zpty ...
2
votes
1answer
109 views

Best Practice for User Shell Scripts location and/or PATH

I am interested in knowing if there is a best practice for placing/storing custom shell (Bash/Zsh) scripts and it's related PATH location. I know folks have their favorite places - I usually dumped ...
0
votes
1answer
31 views

MacOs Terminal zsh - cannot use ansi

my .bash_profile is setting up my prompt like this parse_git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' } export PS1="\u@\h \W\[\033[32m\]\$(...
3
votes
3answers
234 views

How to get fn + left key working on macOS after changing to zsh from bash?

In case it is not clear fn + left key is simply the HOME button. It takes you to beginning of line. This seems to still work when editing a file (in vim) say so I think zsh does something with the ...
5
votes
4answers
1k views

I switched to Catalina and enabled ZSH now my home/end key do not work in terminal

I switched to ZSH from BASH as per the upgrade in Catalina and all is well except my home/end keys no longer work. This can be really annoying trying to move my cursor over super far to the left ...
0
votes
0answers
18 views

MacOS Catalina - iTerm2 - Strange message when rebooting the MacBook pro

When I reboot my Macbook pro and after logging, I have a strange message on a iTerm2 terminal window that appears and that doesn't give the hand : /Applications/iTerm.app/Contents/MacOS/image_decoder; ...
0
votes
1answer
218 views

macOS Big Sur and bash

In Catalina, Apple made ZSH the default shell, however, macOS retained the (now deprecated) Bash. Despite my attempts to unearth something related to this, I couldn't find out whether Big Sur will ...
10
votes
5answers
20k views

chsh doesn't change $SHELL

I'm having some difficulties in changing the value of $SHELL in OSX's iTerm app. iTerm is starting in /bin/zsh, but the value of $SHELL doesn't seem to change. What I've done: Changed "command" as /...
0
votes
1answer
30 views

Ditto command and wildcard on Catalina?

I've learnt a bit about ditto and tried this: mkdir testingdir ditto myfile.css testingdir which seemed to work. How could I ditto one file , e.g. myfile.css to several folders within testingdir, e....
2
votes
2answers
113 views

Resetting /usr/bin [closed]

So I was installing python3, pip, and a few other applications through Homebrew when I first got my Mac. I realized I was doing all this in /usr/bin and not /usr/local/bin, and I wanted to just to ...
0
votes
0answers
46 views

Why is Apple changing the default shell to zsh? [duplicate]

As bash is so broadly available, it provides a good compatibility layer for users that come from other Posix systems to use macOS. Why the move to zsh as the default shell, and why the extensive ...
0
votes
0answers
12 views

Terminal shows “active process” as “-zsh ▸ -zsh”

I have configured Terminal.app to show the "active process" in the tab title. When I open a new Terminal tab, it shows the corresponding field as "-zsh ▸ -zsh" rather than just "zsh" by default: My ...
1
vote
0answers
8 views

Change directory in Terminal if working folder moved to Trash (in interactive shell)?

So occasionally I will be working in zsh, in an interactive shell, and will shift to the Finder (or Path Finder) and while there will throw the folder, that is the current working directory in the ...
1
vote
1answer
77 views

MacOS mdfind/mdutil issue and updatedb command : how to index all the files on my /Volume (root /)

A simple question : on Linux, updatedb command which is launched a second time seems not to reindex all the hard disk. On MacOS Catalina (or maybe for previous), it seems that the command sudo /usr/...
3
votes
3answers
1k views

macOS Catalina still uses bash as the default shell

I'm on the latest public beta of macOS Catalina and it's supposed to use zsh as the default shell and it even shows that it is pointing to zsh in the users settings but whenever I open a new terminal ...
0
votes
3answers
894 views

How to caffeinate a function on CLI?

Mac's caffeinate tool accepts the name of a utility: caffeinate sleep 1, for instance. Is there any way for it to accept a function as well? For example: function mysleep { sleep 2 } caffeinate ...
2
votes
2answers
167 views

MacOS zsh alias pwd is incorrect

I recently switched to MacOS and some aliases in ZSH which were working on a linux system is giving me headaches in MacOS. To be specific, pwd variable inside alias is using the same directory where ...
2
votes
1answer
19 views

Tab key on ZSH terminal in Catalina keeps running “bundle exec jekyll serve”

I don't have jekyll installed on my system ➜ ~ Could not locate Gemfile or .bundle/ directory ➜ ~ which jekyll jekyll not found ➜ ~ which ruby /usr/bin/ruby ➜ ~ ➜ ~ which bundle zsh: correct '...
1
vote
0answers
20 views

How can I get emacs to see ZSH's environment variables when I open it from /Applications

When I launch emacs from ZSH, it works as desired. Specifically, it sees that my HOME directory is /Users/myname/Dropbox, so it looks for .emacs.d there. Unfortunately, when double-click the emacs ...
1
vote
0answers
25 views

How to omit file extension from zsh autocomplete?

I'm new to zsh in Catalina. In .zshrc, I currently have setopt CORRECT setopt CORRECT_ALL When I run a java program from the command line, I want only: % java ProgramName If I type java Pro ...
1
vote
1answer
106 views

iTerm2 - zsh - keep history of commands when opening a new pane

with zsh on MacOS Catalina, when I split my current window of iTerm2 by opening a new pane, I would like to be able to keep in this new pane the history of commands of previous pane (which is still ...
0
votes
1answer
15 views

iTerm unresponsive as xcode attempts (and fails) compiling every startup

Very recently, iTerm has become unresponsive for me when I open new instances of it. Whenever I open a new window or tab of iTerm, Xcode seems to be attempting to recompile a slightly older version of ...
0
votes
1answer
27 views

How can I get .zshrc to run in its entirety every time I open zsh

Here is the entirety of my .zshrc. alias ll='ls -l' export HOME='/Users/rcorty/Dropbox' This file is at /Users/myname/.zshrc. When I start iTerm2, I check whether the home directory was reset by ...
1
vote
0answers
24 views

Will I break anything by changing HOME to /Users/flname/Dropbox

I have two computers and I want to just turn them on and have the same experience on both. I think the best way to do this is to have my preferences files in my Dropbox. Problem is, my applications ...
0
votes
0answers
25 views

Why do my environment variables keep getting wiped out in Mac OS Catalina?

I am currently using MacOS Catalina, and every time my computer boots up from having shut down the environment variables get wiped out. I literally have to manually run export FOO=bar each time my ...
2
votes
1answer
3k views

zsh (brew) and oh-my-zsh: Insecure completion-dependent directories detected (as root user)

When I run sudo -s I get those errors: [oh-my-zsh] Insecure completion-dependent directories detected: drwxr-xr-x 19 myusername MYDOMAIN\Domain Users 608 Feb 10 07:08 /Users/myusername/.oh-my-...
0
votes
1answer
46 views

Catalina's zsh and its .zshrc file

I am trying hard to wrap my head around zsh "upgrade" from bash in macOS Catalina. Most of the things are great, actually. However, I cannot figure out why I am experiencing difficulties, like ...
16
votes
3answers
4k views

ZSH paste from the clipboard a command takes a few second to be write in the terminal

When I copy from the clipboard a long string command in my iTerm, the terminal freeze for seconds. for example, if I copy the following test and I paste in my iTerm console: echo 'test test test ...
0
votes
1answer
27 views

How to save text to speech as a voice recording?

say "Hello World" is pretty neato, but it requires the terminal to stay open. Is there a nice way to save the recording from what a "say" would output as a file?
0
votes
1answer
27 views

How to change the size of the icons that appear in the Terminal.app

After updating to MacOS Catalina 10.15.4 the icons that appear in my Terminal.app have become extremely small. As you can see in the picture, there is a big gap between the arrow -> that is ...
176
votes
4answers
60k views

What are the practical differences between Bash and Zsh?

With the news that Catalina will default to Zsh instead of Bash, I'm finding lots of results telling me about the switch, and that it may cause problems with shell scripts, but I'm not familiar enough ...
0
votes
1answer
166 views

Verifying zsh version on macOS Catalina upon brew install

The default zsh version located at /bin/zsh is 5.7.1 (x86_64-apple-darwin19.0). I brew installed a new version, added /usr/local/bin/zsh to /etc/shells, and issued chsh -s /usr/local/bin/zsh to ...
2
votes
1answer
53 views

Us of the ZSH shell “prompt” command [closed]

I'm new to MacOS command line/UNIX and trying to learn about it and the zsh shell. I have a book on Zsh shell and in an early section it describes use of the "prompt" command. However, my system does ...
7
votes
3answers
1k views

Did the shell ( terminal ) change in Catalina?

My login script is behaving oddly since I moved to Catalina. Particularly this line: # set cursor to display path and command count PS1="<: \w | \! :> " Now my cursor actually has a \w and a \...
2
votes
1answer
185 views

How do I set the working directory as the tab title in Terminal for Mac?

One of my Macs is running Mac OS Mojave and so for parity with my Catalina machine I switched the shell to zsh. Not sure exactly when but at some point I noticed the current working directory was ...
2
votes
2answers
166 views

case insensitive `ls` for Catalina / APFS?

I am trying to find a way to get either the stock macOS ls or (more likely) the GNU ls a.k.a. gls to show my files & folders in case insensitive order. All of my efforts have resulted in ...
0
votes
1answer
53 views

How can I construct my grep command on zsh to return a specific value?

I am trying to use the command line to extract a specific value from a web page. The page is from the VS Code marketplace: https://marketplace.visualstudio.com/items?itemName=HCLTechnologies....
0
votes
2answers
83 views

ZSH prompt issue : commands shifted to the right on one hundred space characters when doing completions, i.e using TAB key

From this post, Get Function Into PS1 (Zsh)? , it seems to be possible to execute a function inside a ZSH prompt`. Here how to use a function into PROMPT : setopt PROMPT_SUBST slash_color () { dirs |...
0
votes
1answer
28 views

ZSH issue with colorized prompt and double slash, i.e “//” appearing when I am into root

I am faced to a problem of appearing slash / appearing double slash into PS1 when I am located on root / . I explain more precisely, I have in .zshrc : setopt PROMPT_SUBST slash_color () { dirs | ...
1
vote
1answer
100 views

How to make path prompt easier to read by color-coding each `/` (forward slash)?

I would like to get another configuration for the path, more a detail than a real request: Below an example of zsh PROMPT : In order to make reading the path easier, I would like to change ...
1
vote
1answer
461 views

ZSH: .zprofile, .zshrc, .zlogin - What goes where?

Now that I've upgraded to Catalina and I am using the new ZSH shell, I've noticed that ~/.bash_profile has been replaced with ~/.zprofile and since installing iTerm2 shell integration, it added a ~/....
1
vote
0answers
36 views

iTerm2 : Adapting zshrc prompt to get the same one than with .bashrc

I switched from bash shell to zsh. After sourcing a main part of my old .bashrc to .zshrc, I am faced a problem concerning the rendering of prompt with zsh (which works with bash) : function ps1 { ...
0
votes
0answers
15 views

Message “anaconda3 Py” in Iterm2 with zsh

I recently installed Anaconda, but in my Terminal (Iterm2), this message appears on the right "anaconda3 Py". I want to remove that message, but obviously without uninstalling anaconda. Maybe the ...
15
votes
5answers
13k views

How to get rid of “You have new mail.” in zsh

I'm using zsh with prezto as my shell with iTerm as terminal app. I always get the message "You have new mail" when opening a new prompt. I don't have any new mail in Mac Mail and I don't run a mail ...
1
vote
0answers
49 views

Why do I have a folder with a question mark on my terminal title bar?

I've been trying to solve this for a few weeks now and the only thread I could find with this issue is this old thread which did not solve my issue. I've checked .bash_profile, .bashrc, .zshrc, ....