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
0
votes
0answers
24 views

Fix terminal shell to defaults

I don't know much about shells, i just now i use some functions in terminal (like xattr, and npm and so...). Recently i tried to do something and i don't remember what i did exactly but now for some ...
0
votes
0answers
20 views

No colors in zsh for first tmux session

When I start a new tmux session (macOS 11.5.1, iTerm2 3.4.10, zsh 5.8, tmux 3.2a) with tmux new, my terminal has no colors, it just displays everything in grey tones. But when creating a new window or ...
50
votes
6answers
98k 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 ...
0
votes
0answers
23 views

When viewing man pages in Terminal, how to get correct man page order priority? `man` shows the correct manpage but Terminal shows an older one

I love using the Terminal's man page viewer. You can right click on anything and open its corresponding man page. Or just run open x-man-page://1/<man page> However, I'm having trouble getting ...
3
votes
2answers
2k 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 ...
1
vote
1answer
124 views

How to remove new line from Terminal on launch?

When I launch terminal, it always puts a new line at the beginning first. I am using zsh and did install ohmyzsh, but I can't seem to find anything that would cause this behaviour. Please see ...
3
votes
1answer
32 views

Determine an SSIDs Index Value in the Preferred Networks List

Im looking for a way to use the macOS networksetup command (and some string/line filtering mojo) to output all SSIDs from the Preferred Networks, and then determine what index my corp SSID is located ...
1
vote
1answer
61 views

Permanently change zsh environment variable on macOS Big Sur?

I tried to customize the ZSH terminal shell (e.g. prompt, auto-completion behavior) by editing the ZSH files, but failed. I have tried both the following, and none worked: Edit ~/.zshrc: When I tried ...
1
vote
1answer
46 views

ZSH conflict with Python setuptools extras and pip?

I have installed python 3.9.7 using pyenv. I then installed a package webchanges which has optional dependencies to be installed using setuptools extras and pip format: pip install --upgrade ...
1
vote
1answer
151 views

macOS .zsh_sessions, .zsh_history, and `setopt APPEND_HISTORY`

On macOS, there is a sessions directory that combines commands from multiple zsh sessions into a single history file. Is it necessary to use zsh shell options in the .zshrc file, to manipulate how zsh ...
3
votes
6answers
130 views

How do I make the Terminal easier to read and mentally process?

I am beginning to learn to use the shell via macOS's Terminal running Zsh, and I'm finding it difficult to process all of the very tightly packed information in the commands and results. What are the ...
17
votes
1answer
30k views

zsh: bad CPU type in executable

I am using the terminal on an Apple M1 MacBook. I try to use a cli tool that is not build for aarm64, so I get this error message in the terminal: zsh: bad CPU type in executable Is there anything I ...
2
votes
1answer
66 views

Terminal cd .. TAB does not add slash

When using the terminal to navigate through my files I was used to be able to type cd .. TAB where the TAB would add the / at the end of the .. and I could just continue typing. Now, on big sur, this ...
5
votes
1answer
252 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=...
1
vote
1answer
41 views

zsh: how do I get ctrl-p and ctrl-n keys to perform history-search-backward/forward like in bash?

In zsh, I can search my history based on what has been typed on the command line so far with: bindkey "\e[A" history-search-backward bindkey "\e[B" history-search-forward ...
14
votes
3answers
36k views

How do I add a directory to PATH when using `zsh` in Sierra

In macOS Sierra 10.12.x, what is the modern way to add a directory to the PATH environment variable that can work across shells or specifically work with zsh shell (I switched from the default bash to ...
1
vote
0answers
54 views

How do I get iTerm2 to split a single session, Terminal-style?

In iTerm2, Cmd+D adds another pane in the window with a new session. Straightfoward, useful - but not what I want. In Terminal, I could use Cmd+D to split the window with the same session. Both ...
0
votes
1answer
276 views

How copy text into Terminal command line zsh?

Somehow something seems to have been changed with my Zsh configuration or Terminal settings under macOS Catalina (10.15.7). If I copy some text, say from a TextEdit window, the usual paste command and ...
4
votes
1answer
220 views

What does the time command do on zsh Mac terminal? And what is the output of "children"?

This is what I got from the terminal command "time". shell 0.32s user 0.08s system 0% cpu 6:09.64 total children 0.10s user 0.16s system 0% cpu 6:09.64 total What is children?
11
votes
6answers
31k views

How to change the default shell in iTerm?

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 /...
1
vote
1answer
61 views

I can't get the zsh-theme to update all the inner shell scripting with each "return" on the terminal

Here is my new oh-my-zsh zsh-theme, updated with an escape character before each code block within $()'s which allows it to update every time the prompt is displayed (works with setopt prompt_subst: ...
0
votes
1answer
71 views

Terminal starts with 'sleep' command?

My machine has MacOS Big Sur 11.4 with silicon chips. I'm attaching two screenshots here. Whenever I start a new terminal, it appears like this one. . The terminal shows the running process which is '...
5
votes
2answers
55k views

How can I get zsh to show the current path in the prompt?

I am not able to see path of my current directory or even username in terminal while using zsh. I was able to see it until few days back. Now it just shows blank. I tried uninstalling oh-my-zsh but it ...
0
votes
0answers
34 views

Paths like /usr/bin, /usr/sbin are still being added to $PATH even without /etc/paths

By default, my $PATH environment variable looks like this: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/zfs/bin:/Users/nate/.nix-profile/bin:/run/current-system/sw/bin:/nix/var/nix/profiles/...
1
vote
1answer
43 views

Difference between using apps from Applications or from some normal folder

When I download an application like Eclipse, Postman etc, Mac ask me to drag the app into Applications folder. Another way which I follow is to save this .app file in some folder and use it from there....
5
votes
4answers
16k views

ZSH - missing git icons

Hi I've just installed ZSH and it looks awesome but git icons are still missing and I don't know what I miss. What I should do?
1
vote
1answer
2k views

Running shell or Bash scripts with zsh on macOS v11 (Big Sur)

Every time I need to run a shell script, I need to enter chmod +x <filename> For example, if I want to run this sample script named "run", #!/bin/bash javac --version I have to go ...
1
vote
1answer
56 views

How to disable "Restored Session" message from appearing every time I run Terminal?

Every time I run terminal on macOS BigSur I see a message like this: [Restored 10 Jun 2021 at 12:18:19] Restored session: Thu Jun 10 12:18:16 WEST 2021 I want the sessions to be restored. I don't ...
0
votes
0answers
34 views

Is there an easy way to zsh history entries from actions I do in Finder (copy, move/rename, delete) for personal auditing purposes

When I copy, rename, delete files/folders in a terminal, I can see a list of everything I did using the shell's history file. This helps me know why and when I did some action. The problem is that ...
0
votes
0answers
80 views

Why does setting Neovim as a man pager break GNU Info?

I know that this is sort of a 'Linuxy' question but it is Mac specific so I am putting it here. When I am working in the terminal on my mac (Catalina 10.15.7) I want to use Neovim rather than Less to ...
1
vote
2answers
890 views

How to delete the terminal history in macOS Big Sur?

I'm trying to delete the terminal history but the .zsh_history does not allow me to run it, it says permission denied. Please help.
0
votes
1answer
105 views

I am typing into my terminal and the stdin is changing and adding characters on its own

I am using curl on my Macos Catalina terminal app, and the text I enter in stdin gets altered on me pressing enter Enter. For a simple example: curl -d " 印度是最好的 The weather is good" -X POST ...
2
votes
3answers
144 views

How to focus parent terminal tab of shell script for input?

I have a zsh script where I prompt for user input every 15 minutes. How can I make the tab of Terminal that the script is running in open up / focus? open -a Terminal just opens the whole window. I'm ...
1
vote
2answers
60 views

Finding the mountpoint of an device in shell scripts

Looking for a correct and simple way to find a mountpoint in a shell script. This working as expected tmp=$(mktemp /tmp/my.XXXXXX) mpoint=$(diskutil info -plist disk1s1 >"$tmp" ; /usr/...
0
votes
2answers
94 views

How to change binding in zsh? command key vs control key

I moved to Mac OS and I'm facing the control vs command key problem. I already changed the settings for my external keyboard, so that my control key is mapped to command key and viceversa. This fixes ...
1
vote
1answer
163 views

What has caused the CTRL + x + e shortcut to stop working in the shell?

The CTRL+x+e keyboard shortcut allows you to open your favorite editor, as defined in the $EDITOR shell environment variable. This has stopped working for me recently, but I am not sure what changed. ...
1
vote
1answer
124 views

When I open the terminal I get the error /Users/sanjayshreeyansgmail.com/.zshrc:17: command not found: “export

When I opened terminal today, I see this error /Users/sanjayshreeyansgmail.com/.zshrc:17: command not found: “export. All commands seem to work fine, it is just my inner perfectionest screaming. I ...
0
votes
1answer
156 views

Copy file to protected directory using AppleScript

I'm trying to simulate Finder's file copy, but to a protected directory, using AppleScript. The goal is to copy a single file but elevate when needed, like Finder will behave when doing it manually. ...
0
votes
1answer
111 views

zshrc file invisible in finder but present in terminal [duplicate]

When I give ls-a in my root folder I can actually see zshrc. but when I open my root folder in finder using the open . command, It's not visible. Actually many files are missing..As you can see the ...
4
votes
1answer
956 views

Why is ~/.zprofile always sourced on every interactive session?

from zsh document, ~/.zprofile should only be sourced at login shell, and should NOT be sourced at every interactive session (for example, a new tab in a terminal). I am running MacOS Big Sur 11.2.3 (...
2
votes
1answer
466 views

MacOSX Big Sur - Terminal ZSH Shell Command's Execute Sometimes With "!" Exclamation Symbol In Front

Is this normal behavior for MacOS Big Sur ZSH (Z Shell) terminal? Sometimes shell commands such as find and or launchd as just a simple example execute properly. This is with the exclamation symbol &...
0
votes
1answer
1k views

Is it possibile .zshrc is not available in ~?

I can’t find the file zshrc in my user home folder, is it possible it doesn’t exist and I have to create it as a new file? I use zsh as default shell on macOS 11.2.3
2
votes
1answer
123 views

Why I do I see these lines in Terminal and how can I remove them?

Last login: Fri Mar 26 00:39:29 on console export HOMEBREW_PREFIX="/opt/homebrew"; export HOMEBREW_CELLAR="/opt/homebrew/Cellar"; export HOMEBREW_REPOSITORY="/opt/homebrew&...
2
votes
2answers
10k 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 ....
1
vote
1answer
32 views

How to change this terminal customization tutorial for usage in zsh rather than bash?

This tutorial gives instructions on how to customize the look of macOS's Terminal application. I followed the instructions but used zsh where it said bash in hopes that it would work, but it didn't. I ...
2
votes
1answer
176 views

How do I use a glob with parentheses in Zsh?

This: cp ./hb_(lys|gln|thr|glu|ace|nhe)*_aacH*.ptraj ./ Works just as intended when executed in the terminal. However, putting the same line in an executable script does not work as I receive a ...
1
vote
0answers
24 views

Control key not working in Kitty or Alacritty but it works in iterm2

I'm using zsh with iterm2 but I wanted to switch to another emulator like kitty or alacritty and I have a problem which I cannot figure ot: In iterm2 Control based combinations work but in kitty or ...
1
vote
1answer
55 views

Zsh syntax question

I am using a script on my iMac (Automator) that I found on macmost.com that contains the following lines: #/bin/zsh for f in "$@" do filedate=$(mdls $f | grep kMDItemContentCreationDate ...
30
votes
1answer
148k views

How to uninstall zsh

I'm new to Mac. A friend installed all kinds of additional software including zsh which I would like to uninstall. So how can I uninstall zsh?
0
votes
0answers
25 views

iTerm2 captured output with watch script

iTerm's Captured Output is a great feature: I can run a build and open any files with problems, focused on the troublesome line in whatever editor I choose. The one problem I've had with it is running ...

1
2 3 4 5