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
1
vote
0answers
26 views

Run shell script by double clicking in non-login prompt in terminal

This question is super similar to this, but I'm curious how to launch the shell script in a non-login shell prompt. I already have it set up to run with iterm2 when I double-click. I don't really care ...
0
votes
0answers
19 views

Zsh cleanup for clean lookup? multiple zsh in both /usr/local/bin/zsh & /bin/zsh

The "command not found" problem shows up consistently. I am currently on Mac Catalina. I am wondering if the root to this is that when I: where zsh it shows: /usr/local/bin/zsh /usr/local/bin/...
0
votes
2answers
68 views

Synchronise or share .zshrc between accounts

I have a standard user account (in Mojave using zsh shell) and based on Gentoo Wiki I have added this to my .zshrc to show a prompt like [user@computer] ~ $ if [[ $UID == 0 ]]; then PS1="[%n@%M] %~...
0
votes
1answer
31 views

How do 3rd-party programs modify the $PATH variable?

When I echo my $PATH variable, I see the binaries of some programs that I have previously uninstalled, and conversely, I do not see the path to some of the binaries that I can use, such as code. I am ...
0
votes
0answers
15 views

.cshrc permission is breaking from User Templates on Catalina

I'm facing a strange issue on Catalina. We used to symlink our master .cshrc file to User Templates from our network mount. It used to go to every user's home directory and uses it. But, ever since ...
2
votes
1answer
35 views

Partially delete path in zsh (Option + Backspace)

In zsh Option + Backspace deletes the whole path on a prompt. For example: ls /usr/local/bin Option + Backspace returns: ls How can I set the same behavior so that the shortcut deletes just one ...
1
vote
0answers
51 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-...
1
vote
1answer
24 views

Why is Python version set with PyEnv global not picked up a default one?

I have installed pyenv and used it to install Python 3.8.1 I had Python 3.7.6 installed manually before. I have set 3.8.1 as global and, as this version is now markered with *, it was taken into ...
1
vote
1answer
42 views

No package manager on brand new macOS Catalina

I'm sorry if this is a stupid question, but I've been searching for days with no results. What is the default package manager for macOS Catalina terminal? % brew zsh: command not found: brew I've ...
1
vote
1answer
43 views

zsh: Can't set DYLD_LIBRARY_PATH in ~/.zshenv to get ImageMagick working under MacOS Catalina

Goal: Install ImageMagick on my iMac 27" 2017 running Catalina 10.15.3 (install failed under Homebrew). Plenty of RAM & disk space. Second line below doesn't execute, so echo $MAGICK_HOME yields ...
2
votes
1answer
66 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 ...
2
votes
2answers
53 views

Using the command-line / Terminal, is it possible to determine if this Mac has Touch ID or not?

I am trying to find a way, using the Terminal/command line, to determine if the Mac I am using has Touch ID or not. So far web searches have not turned up any answers. I would have thought that ...
0
votes
1answer
212 views

Add colours to output of existing CLI commands

I would like to create a function / alias that colorizes the output of another command. Is there a best-practice way to do so? For instance, let's take the alias command, whose output looks something ...
1
vote
1answer
395 views

How to set “default” .bash_profile when opening Terminal on Catalina

I'm running Catalina, 10.15.2, which uses the new zsh shell as a default. I've created my own .bash_profile file in my home directory and I'm able to initialize this .bash_profile by typing: source ....
5
votes
3answers
537 views

Now that MacOS Catalina has moved to zsh, can I upgrade bash 3.2.57 with 5.0.3?

I understand apple's move from bash to zsh, though I'd really rather that they hadn't made the change. I've tried zsh, and decided that I'd prefer to remain with bash. So, since MacOS Catalina isn't ...
2
votes
1answer
175 views

How to make auto-complete work for AWS on ZSH?

I installed awscli from brew. The amazon instructions refer to a shell script, aws_zsh_completer.sh that doesn't appear to be included. I do have an /usr/local/bin/aws_completer. How do I make the ...
2
votes
1answer
68 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 ...
0
votes
0answers
210 views

How to change zsh prompt which now shows probably MAC address?

I have been try to change the prompt on my terminal and the prompt that shows up looks like a MAC address. This is what it looks like: Last login: Mon Dec 16 20:41:33 on ttys000 ...
0
votes
2answers
85 views

Hide name of the user and computer name from terminal window title

Before Catalina it was possible to hide username and computer name from terminal window title: Yet now despite any combination of configuration I'm unable to hide those items from window title:
13
votes
4answers
4k views

Why can't I use zsh?

So I upgraded to Catalina. Actually it's more like a fresh install, I only copied across the few files I wanted to keep. The shell is now helpfully telling me: The default interactive shell is now ...
1
vote
0answers
105 views

After switch to zsh history not saved

I am running Mojave have changed default shell from bash to zsh. I notice history is not saved between sessions. Following recommendations in What are the practical differences between Bash and Zsh? ...
0
votes
0answers
13 views

Associate automation applescript with hotkey or shortcut or launcher icon [duplicate]

I came across a very handy approach based on applescript to automate some repetitive tasks on iterm. Here is the example script: #!/usr/bin/osascript tell application "iTerm2" tell current ...
1
vote
1answer
248 views

Can't use zsh shell in Catalina

When I opened Terminal after installing Catalina, this appeared: The default interactive shell is now zsh. To update your account to use zsh, please run `chsh -s /bin/zsh`. For more details, please ...
7
votes
4answers
827 views

How to prepend a character to start of each line in 250,000+ line file using a script?

I have text file with 250,000 lines - and I need to append the same single character at the start of each line. I have tried to use various multiline /column edit plugins in Atom and Sublime but they ...
1
vote
2answers
311 views

How does zsh find commands?

Unless I switch back to bash, I now have to spell out the full path for scripts I have written. How does zsh find commands? Things in /bin, /use/bin, etc. still work, but things in ~/bin are “not ...
0
votes
1answer
57 views

SOCKS proxy environment variable ignored by command line applications

I have a SOCKS proxy that is accessible at 192.168.0.17:1080 in my local network. I redirected my internet traffic to it in my Wifi System Preferences. This works fine, GUI applications use it. ...
2
votes
1answer
195 views

Which version of ZSH is installed in macOS Catalina?

I am required to write a script on Linux while still supporting macOS. I am using ZSH. macOS Catalina has ZSH enabled by default, but the feature I am building has a version dependency on the ZSH ...
2
votes
1answer
75 views

Resetting /usr/bin

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 ...
1
vote
1answer
356 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 ...
2
votes
1answer
44 views

Effects of changing shell

Recently Apple changed the default shell to zsh from bash. In the past I made significant changes to my .bashrc file. How should I incorporate those changes into the zsh terminal?
3
votes
0answers
113 views

Show menu bar icons in Catalina defaults command not working

In Catalina, allowed ZSH full disk access in preferences and ran defaults write com.apple.systemuiserver menuExtras -array "/System/Library/CoreServices/Menu Extras/Bluetooth.menu" "/System/...
3
votes
1answer
845 views

Easiest way to migrate aliases from bash to zsh

I want to start using zsh as recommended by Apple for Mac OS Catalina. How do I migrate my aliases that I have defined in the ~/.bash_profile to the new shell?
2
votes
0answers
35 views

Why doesn't Spotlight look inside shell scripts?

I have a bunch of shell scripts (all plain text files) in /usr/local/scripts If I do fgrep -il '@todo' * there are 14 files which match. If I do mdfind -onlyin /usr/local/scripts '@TODO' there are ...
2
votes
1answer
83 views

MacOS terminal Hangs on `login`

On my macbook, I've found that sometimes it gets into a state where it cannot open up a new terminal - a blank terminal window just appears, and it hangs. Rebooting solves this, but it seems to ...
1
vote
1answer
30 views

Command line issues

I'm trying to execute two commands in a single line: pkill "something" && runsomething when executing each command separately, both work. When executed together with "&&", only the ...
3
votes
2answers
92 views

Why is the width of `~` different than `➜` on iTerm2 when using zsh with spaceship-prompt?

Using iTerm2. Installed zsh, spaceship-prompt and FiraCode. Why is the width of ~ different than ➜?
2
votes
1answer
110 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
3answers
707 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 ...
1
vote
1answer
89 views

Problem with snippets in Zsh

I recently changed my shell from bash to zsh. I have lots of snippets (Alfred, Dash...) for terminal use that ends with a line break. With bash that snippets works fine, I meant, paste the command and ...
2
votes
1answer
121 views

How to find the PID(s) of a hung app in macOS from the shell (Terminal)?

Within Activity Monitor.app it's easy to visually identify a hung app by seeing its name in red text: How can such hung app statuses be identified from the shell (Terminal.app) and the PID(s) of ...
1
vote
2answers
642 views

Why does rm in zsh abort?

I have a number of files: > $ ls FleurInputSchema.xsd inp.xml out usage.json fort.77 juDFT_times.json out.xml and I would like to delete some of ...
129
votes
4answers
34k 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 ...
4
votes
0answers
110 views

Separate zsh histories after restart (iTerm2)

I am running iTerm2 (v 3.2.9) and zsh (v 5.7.1). I normally have 3-4 iTerm tabs opened at the same time and each tab has its own history thanks to the following settings in my .zshrc file SAVEHIST=...
5
votes
2answers
730 views

How do I switch tabs when using iTerm2 with Z shell

How do I switch tabs when using Z shell on iTerm2? I have already tried all the possible key combinations. Here is an image of my current setup: OS: macOS Mojave 10.14.4 (18E226) iTerm2: Build 3.3....
1
vote
1answer
139 views

macOS Terminal.app can't split with Command + D

I installed zsh. When I press Command + D in iTerm2, it could split normally. But when I return to using Terminal.app, I use bash or zsh, it can't split with Command + D, it changed like the ...
2
votes
1answer
107 views

LSCOLORS and CLICOLOR active by default and unset

Running zsh out of the box ls -G produced a colored list with the default colored values. But when I echo, both $LSCOLORS and $CLICOLOR, I receive an empty response. Reviewing printenv or set also do ...
9
votes
4answers
13k views

How to add permanent environment variable in zsh

I have been scouring the internet, and cannot seem to find a solution to permanently adding an environment variable, specifically when my OS is macOS Mojave (10.14). It seems there are a lot of ...
1
vote
0answers
188 views

How to bind Option-Delete to backward-delete-word in zsh vi mode in tmux and alacritty terminal

I use alacritty and currently, I have these key binding key_bindings: # (macOS only) - { key: N, mods: Command, action: SpawnNewInstance } - { key: F, mods: Command, ...
0
votes
0answers
51 views

Find commande doesn't list existing file

Ok so! I search the file latexindent. The command typpe latexindent given me latexindent is /Library/TeX/texbin/latexindent. I execute find /Library/TeX/texbin/ -name "*latexindent*" but I don't have ...
5
votes
1answer
1k views

Update zsh on macOS Mojave

On my MacBook Pro with macOS Mojave, my version of zsh is 5.3. zsh --version zsh 5.3 (x86_64-apple-darwin18.0) That version is a few years out-of-date, according to this. That page shows version ...