Questions tagged [zsh]
Zsh or Z Shell is the default Unix shell used by Terminal in macOS since 10.15
417
questions
1
vote
2
answers
62
views
Terminal | Shortcut for Automatically Saving Files Created Using "code"
I have a question regarding a shortcut use of "code".
My Goal is to simultaneously:
Open a new file in VS Code, and also:
Automatically save that new file to my current working directory
...
1
vote
2
answers
81
views
zsh - Sort files expansion in MacOS Terminal like in Finder: numerically and case-insensitively
Is it possible in MacOS Terminal to have the sort order numerically and case-insensitively, almost like in Finder?
I'm on MacOS 14 Sonoma, using Terminal app with zsh 5.9 and oh-my-zsh.
I'm trying to ...
0
votes
0
answers
32
views
I tried $arch -x86_64 zsh and receive arch: posix_spawnp: zsh: Bad CPU type in executable
~ arch -x86_64 zsh
arch: posix_spawnp: zsh: Bad CPU type in executable
~
Rosseta of course installed. I tried everything and Googled everything. What should I do?
2
votes
2
answers
125
views
Risk of uninstalling a customised zsh version
Having been confronted to a minor bug on Apple Terminal, I followed naively an advice on an internet website recommending to update my shell zsh to latest version, using brew. Which I did. (and it did ...
3
votes
0
answers
119
views
.zsh_sessions producing an error [duplicate]
Each time I open Terminal, I get an error:
/Users/myname/.zsh_sessions/SESSIONID.session:2: command not found: Saving
in each of the windows I set to open by default. This seems to have appeared a ...
0
votes
0
answers
53
views
How to turn off zsh automatically restore session in Terminal.app
This question is related to How to turn off zsh save/restore session in Terminal.app. However, I don't want to shut down sessions completely setting SHELL_SESSIONS_DISABLE=1 in my .zshenv. I want to ...
1
vote
1
answer
91
views
Homebrew not installing correctly
I was installing homebrew through the .pkg to install GNU Emacs, and it did not run after installation. I ran brew help and it outputted zsh: command not found: brew. Command Line Developer Tools were ...
0
votes
0
answers
44
views
MacOS Warning on Terminal Startup: "Warning: No available formula with the name "pure#". Did you mean pure?"
I recently tried to install a zsh prompt called pure, where I followed the instructions listed on its Github page
https://github.com/sindresorhus/pure
I set my ZSH_THEME = "", ran brew ...
0
votes
1
answer
60
views
Misleading diagnostic message
I generally use /tmp/tmp for throwaway files, but when I accidentally missed the slash, I got:
WGroleau@MBP ~ % find /Users -name "Cami*x" -print > /tmptmp
zsh: read-only file system: /...
1
vote
1
answer
177
views
Trying to read xattr values on multiple files
In trying to read all the values of the extended attributes on a single file, if I do
xattr -l <filename> | while read ATTR; do
xattr -p $ATTR <filename>
done
I get what I expect. But ...
0
votes
0
answers
44
views
What is this zsh file generated unintentionally every time I use zsh
The file name is zsh.<computer_name>.local.<random_numbers>. In this case it is zsh.macbook.local.754. It started appearing after I moved all zsh files in the home directory to ~/dotfiles/...
7
votes
3
answers
1k
views
Terminal: How to move files to the last used directory conveniently?
I googled to no avail and could not find any example.
For example, if I want to move files to the current dir I can use .
But what if I am in ~/foo and cd into ~/foo/bar/xyz/dir and want to move, say, ...
1
vote
1
answer
214
views
Is there a way to jump within a word using option with arrow keys in iterm2
What is the issue?
I have been using the ⌥ + → & ⌥ + ← shortcuts to navigate between words, along with ⌘ + → & ⌘ + ← shortcuts to navigate to the end / beginning of the line in iTerm2. It ...
1
vote
1
answer
107
views
Tilde expansion broken
Today tilde expansion has broken on my Mac.
$ cd ~
-bash: cd: ~: No such file or directory
I use vi-mode on zsh along with oh-my-zsh and thought that could be causing the issue. But switching ...
0
votes
0
answers
19
views
How to configure the word break on Intellij terminal for Opt+Backspace
When I press Opt+Backspace within Intellij (Goland) terminal using zsh in macOS, it deletes the words until it encounters a word separator like a period, space, comma, or a dash.
How do I configure it ...
0
votes
1
answer
122
views
Mac Terminal and applications version installed
I have the zsh in Ventura OS. I know that I have already installed the following apps:
Books.app (which came already in the system)
Brackets
MAMP (Package for MySQL, Apache and PHP)
Adobe Photoshop
...
0
votes
2
answers
147
views
How to copy an application folder (.app) using terminal
I have an application I downloaded in a form of .app file in downloads.
How can I copy it to /Applications using the terminal?
Since it is actually a folder I can use cp directly so it seems.
Using ...
2
votes
1
answer
191
views
Mimic Terminal.app behavior in iTerm2 for option-arrow keys (left and right)
This is probably related to this question:
How do I do Home and End in iterm2?
but fiddling with the iTerm2 key mappings (both general and per-profile) to un-map option plus the left and right arrow ...
0
votes
0
answers
125
views
Mac OS: Execute a command in .zshrc (or .bashrc) only for new windows but not for new tabs
I'm trying to change the "default working directory" for Terminal.app and it seems that is not possible (from my research so far). I could achieve this using ~/.zshrc (by adding "cd ~/...
0
votes
1
answer
54
views
terminal process completed
whats wrong? why this happened?
i can't use terminal and write anything after 'process completed'.
Last login: Thu Jul 27 02:17:19 on ttys000
export MAVEN_HOME=$HOME/apache-maven-3.9.3
export PATH=$...
1
vote
2
answers
229
views
defaults delete is not working
I've made a bit of a mess with my Mac (macOS Ventura 13.5) whose shell is zsh. The problems started when I used python syntax to run commands, as it's a requirement apart of the project I'm doing to ...
5
votes
1
answer
482
views
How to make normal command `ls` and the wildcard `*` in Zsh
Let's consider the interaction with Zsh on a Mac:
% ls |grep gradle
gradle@7
% ls gradle*
INSTALL_RECEIPT.json LICENSE NOTICE README bin ...
1
vote
0
answers
67
views
Terminal echos out environment variables when opening a new window
When I open up a terminal (Apple Terminal, iTerm2, Hyper), the terminal echos out many environment variables and then shows the command prompt at the end, I'm not sure what has caused this. I ...
0
votes
1
answer
72
views
Where is `HOST` being set to `x86_64-apple-darwin13.4.0`
This is the last line of my .zshrc:
export HOST="localhost"
How is this happening?
❯ source ~/.zshrc
❯ echo $HOST
x86_64-apple-darwin13.4.0
2
votes
3
answers
634
views
Renaming multiple files with mv gives "zsh: no matches found: *.pdf"
So I have these files:
Movies % ls -l *."pdf - yts"
-rw-r--r--@ 1 staff 1848890 Mar 18 00:11 Scanned Document 1.pdf - abc
-rw-r--r--@ 1 staff 1848890 Mar 18 00:11 Scanned Document 2....
0
votes
0
answers
65
views
Sudden unexplained change in perl behavior
I've been using zsh for at least a year, and I use perl in Terminal every day.
Today, for the first time ever, launching Terminal got this:
Last login: Thu Jul 13 08:50:35 on console
Attempting to ...
1
vote
2
answers
148
views
Escaped newlines make the code work wrong. Why?
From a Markdown style guide by Google:
Because most commandline snippets are intended to be copied and pasted directly into a terminal, it's best practice to escape any newlines. Use a single ...
0
votes
0
answers
67
views
How to produce unformatted output from man? [duplicate]
I stumbled over this problem with the following simplified example:
man zsh|grep zshparam
produces no output, even though the zsh-manpage contains pretty close to the top the string zshparam. ...
2
votes
1
answer
406
views
Auto suggestions for Docker container names with ohmyzsh
I'm migrating from Ubuntu to MacOS with my MacBook Pro (M2). I'm using ohmyzsh with the docker and docker-compose plugin. Docker has been installed with Docker Desktop setup.
All works fine except the ...
2
votes
2
answers
169
views
How can I access `~/Library/Messages`?
I'd like to copy manually into ~/Library/Messages to maintain message history.
The folder is owned by the user, not by root:
% ls -al ~/Library | grep Messages
drwx------ 11 sam staff 352 29 ...
0
votes
1
answer
312
views
Where can I find the alias file in macOS
When running the command alias in Terminal.app, it outputs a few aliases that I am unable to find within my $HOME and /etc directories. The output of the current alias is
run-help=man
which-command=...
1
vote
1
answer
63
views
Error message about `cal` regarding locale
MacOS 12.6.5, running zsh:
I just noticed, that when I type
cal
I get the error message
cal: setlocale: No such file or directory
along with the calender to be displayed. Why is this the case?
More ...
0
votes
0
answers
28
views
Task scheduled as a cronjob not executing [duplicate]
On my Macos 11.6.1, I want to execute a script 'task1.zsh' with the following content
#!/bin/zsh
/usr/bin/touch /Users/user/Documents/cronjobs/hello.txt
echo hello >> /Users/user/Documents/...
3
votes
4
answers
722
views
Automatically rename files for OneDrive
I have hundreds of files with invalid symbols for OneDrive (\/:*?"<>|) and I want to automatically rename them on my Mac so they can save up to the cloud.
OneDrive for macOS does not seem ...
0
votes
0
answers
105
views
Apple Automator “zsh:1: command not found: legendary”
This might be the thousandth post about this, but I can't find the answer. Anyway as the title states when I try to run a terminal command to use something called legendary in automator which is an ...
1
vote
1
answer
64
views
Cannot create alias for a script
I am making an alias for Bazelisk, as I have installed a jailbroken version of brew (edited the code so I did not have to use sudo privileges to install). However, because of that, Bazelisk is not ...
1
vote
1
answer
201
views
Why are all my new installations on my M1 Mac (zsh terminal) not being installed to my PATH and instead to /Users/myusername/Library/?
I just recently got a M1 Mac which uses the Z-shell (zsh) terminal. All my new installations that I run through my terminal (such as on homebrew, npm, etc.) are installed to /Users/myusername/Library/ ...
0
votes
1
answer
730
views
most terminal commands are killed
I have this problem since weeks: my ZSH terminal on start up shows an error and even with most commands (especially if they are sudo).
All results are "killed", sometimes with "Killed: ...
1
vote
2
answers
365
views
Mac Monterey Terminal restores itself after every restart
Not long ago I noticed that when I open zsh and enter "last" it displays my login dates but now below each instance there is a gray bar with the text [Restored MONTH DAY, YEAR at TIME]
I do ...
3
votes
2
answers
381
views
What are the directories I see when I hit tab on `cd ~` that are not seen in `ls ~`
When I hit tab on cd ~, I see a lost of directories starting with _ so something like _dirName which are not see when I list ls ~. I also see myUsername, root, daemon, nobody, Guest directories. What ...
-1
votes
1
answer
465
views
zsh:killed /usr/libexec/java_home -V after running /usr/libexec/java_home -V
I am trying to run /usr/libexec/java_home -v, and I am getting this error :
zsh:killed /usr/libexec/java_home -V
What did i try?
Reinstalling brew.
Changing shell to bash. It throws killed : 9
When ...
0
votes
0
answers
1k
views
zsh: bad CPU type in executable: ngrok
I have a mac processor 1.1 GHz Dual-Core Intel Core i3 and macOS Catalina
I install ngrok AMD64 from the website https://ngrok.com/download
I keep getting the error: zsh: bad CPU type in executable: ...
0
votes
0
answers
374
views
Using Powerlevel9k with oh-my-zsh showing powerlevel9k icons but showing weird character '?' for zsh icons on my Mc Book terminal
I've been using powerlevel9k with zsh since many years now on my Mac Book. But since few days that I bought a new Mac Book Pro Ventura 13.3.1, and reinstalled powerlevel9k and oh-my-zsh the same way I ...
0
votes
1
answer
50
views
Inconsistent handling of URI
I have a script that contains these two lines:
open https://ldsgenealogy.com/10-Free-Useful-Websites-for-US-Genealogy-Research.htm
open https://UniGen.us
Every time I invoke this script, another tab ...
0
votes
0
answers
72
views
Prevent double clicked SH script from being entered into ZSH history on Mac
I've got some SH scripts which I double click to run. The scripts run as intended, after having set the working directory via cd "$(dirname "$0")" at the beginning of the script, ...
1
vote
0
answers
66
views
Remove unwanted entries in $PATH [duplicate]
I have multiple entries in my $PATH. I learned a ton about the path environment variable yesterday, but prior that I must have added some entries multiple time, or something.
I have searched for this ...
1
vote
1
answer
2k
views
zsh: bad CPU type in executable (on Intel, not M1)
I have the reverse case of the other question with the same name (zsh: bad CPU type in executable).
I used the mac moving assistant to go from an M1 to an Intel, and the PHP that is used in my ...
1
vote
1
answer
55
views
How can I work out what a zsh command needs as input in a standardised way?
I'm trying to make some sort of GUI for the zsh/bash terminal, just as a fun learning project, but most commands in zsh/bash need you to put in some sort of extra input, alongside just the command. Is ...
2
votes
1
answer
403
views
how to let `clear` command just clears the current screen
I use iTerm2 apps as my terminal option on my Mac computers.
On my 1st Mac, when I type clear, it just clears out the current screen, and when I scroll up, it could still show the previous contents on ...
5
votes
3
answers
1k
views
How to turn off zsh save/restore session in Terminal.app
I'm running a zsh non-login shell (zsh version 5.8.1) in a tab of Terminal.app under MacOS 12.6.5.
When creating interactive child-zsh processes and exit them, I see a message
Saving session......