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
16 views

Us of the ZSH shell “prompt” command

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 ...
0
votes
2answers
25 views

How do I use ls command with a variable for a directory in zsh?

I set a variable named $G2_HW_sci. This is the output with echo. user@192 SS % echo $G2_HW_sci ~/Documents/trabalho/SS/G2/science/homework/student_work/ Then I tried to ...
1
vote
1answer
26 views

How to organise overflowing config files and folders in the home directory and beyond!

The Context: I'm a long-time macOS user who has spent many years dabbling here and there with the *nix side of Apple life since the first iteration of OS X (10.0) originally shipped. Recently, I ...
0
votes
0answers
21 views

Where does zsh get the values of LANG & LC_CTYPE if it is not in .zshrc?

Where does zsh get the values of LANG & LC_CTYPE if it is not in .zshrc ? I check my ~/.zshrc and it didn't set them, but if I run printenv I find they were both set, although not the values I ...
1
vote
1answer
24 views

pkgbuild open URL using default browser

I use pkgbuild to create an Apple installer .pkg. In my preinstall script, I have the following, which opens in Chrome if I invoke it myself, however when run by pkgbuild script, always opens the ...
0
votes
0answers
19 views

nvm (node version manager) nvm,node,npm not found

I did install nvm regarding the documentation, then installed the latest LTS node, nvm install 12.16.1 and globally installed yarn. everything was working well, the node -v and npm -v and which node ...
3
votes
1answer
284 views

sudo: setrlimit(8): Invalid argument after switching Mac OS shell from BASH to ZSH

After updating to Mac OS Catalina some months ago, I followed the prompted suggestions and changed my shell from BASH to ZSH. Since that time, whenever I use sudo in Terminal, I get sudo: setrlimit(8)...
1
vote
1answer
46 views

deleting single entry from history in zsh — Terminal

Is there a straight forward way of deleting a single entry from the shell history in the "new" zsh shell? I know fc does not support this and I can't even figure out where Apple now stashes the ...
1
vote
1answer
89 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 ...
2
votes
1answer
65 views

Zsh moves texts when the prompt is too long

Steps to reproduce: Resize the terminal to width 80 or less, making it easier for prompt to wrap. Temporarily rename /etc/zshrc in case it affects outcome. (Remember to change it back afterwards!) ...
1
vote
1answer
69 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
22 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
82 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
36 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
17 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
47 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
596 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
56 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
104 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
76 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 ...
3
votes
1answer
105 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
74 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
213 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
1k 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
815 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
349 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
93 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
229 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
135 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
5k 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 ...
2
votes
0answers
179 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
296 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
847 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
403 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
79 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
223 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
81 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
2answers
492 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
120 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/...
4
votes
1answer
1k 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
36 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
85 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
31 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
100 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
121 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
804 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
93 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
130 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 ...