Questions tagged [zsh]

Zsh or Z Shell is a Unix shell

Filter by
Sorted by
Tagged with
2
votes
1answer
43 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 ...
0
votes
3answers
43 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
1answer
45 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
40 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
1answer
42 views

how to reset $SHELL variables in root from user space

I've switched my bash to zsh in root using chsh -s /usr/bin/zsh root After when I change back to bash, I type the wrong path: chsh -s /usr/bin/bash root Now I cannot enter root and I get this ...
1
vote
2answers
98 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 ...
46
votes
3answers
5k 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 ...
1
vote
0answers
42 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
72 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
95 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 ...
1
vote
1answer
39 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 ...
2
votes
3answers
3k 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
93 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 ...
4
votes
1answer
404 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 ...
0
votes
0answers
21 views

Rename .app and using the new name with open -a

I want to change the name of Visual Studio Code to vscode for using the command open -a vscode. Any idea how?
0
votes
2answers
630 views

After uninstalling Oh-My-Zsh, my terminal is messed up

This is not a duplicate question. I've already looked at the answers for Uninstalled zsh, terminal gone weird, and although I changed the settings, it still defaults back to zsh title, with a ...
1
vote
1answer
37 views

zsh array from variable does not work

I using macos 10.14.2 (18C54) with zsh (latest version I couldn't find any versioning with zsh). If I create an array from a string it works. But If i use a variable containing the string split does ...
5
votes
2answers
890 views

Cut in CLI doesn't work as expected - returns full lines every time

I'm running MacOS Mojave and I'm trying to get a list of owners of files in given path. I'm trying to do it like this but it doesn't work. $ ls -l /usr | cut -f3 total 0 drwxr-xr-x 971 root wheel ...
0
votes
1answer
138 views

Randomize MAC Address Using Platypus [duplicate]

I am running the following script in Platypus but the MAC address does not change: #!/bin/zsh IF=en7 mac=`ifconfig $IF | awk '/ether/{print $2}'` echo "$IF mac before change=$mac" randmac=`openssl ...
2
votes
1answer
291 views

How do you change colour scheme between *panes* inside iTerm2 + oh-my-zsh?

I have seen a lot of solutions that allow changing of tab colour upon remote accessing into a server (see for example: https://gist.github.com/wadey/1140259 and many more). What I want is to change ...
3
votes
2answers
663 views

Zsh vs Bash shell in Terminal [duplicate]

Are there any advantages to using zsh vs bash shell in Terminal app? Also, can you use zsh from the terminal? My understanding of zsh is skewed.
1
vote
1answer
88 views

macOS terminal: quick way to edit command options after bash/zsh autocomplete

The issue I use autocomplete from history a lot whether that's with up-arrow or typing the first few letters and completing the whole command including all arguments (options and others) with right-...
0
votes
0answers
121 views

Terminal and iTerm appear to be partially opening in zsh

I recently installed Julia on my iMac running High Sierra. Julia seems to want to run in the Z-shell whereas I normally use bash. I haven't run Julia today but my Term2 windows are screwed up since ...
2
votes
1answer
1k views

Scrolling doesn't work in Terminal for commands like less

I used to be able to scroll using the trackpad through git diff or man pages which both use less when the output doesn't fit on screen. Today I restarted my computer and that behaviour is gone and I ...
1
vote
2answers
107 views

ZSH started printed env on startup

I started XTerm today and for some reason ZSH is printing what looks like env when my shell starts up. I am just wondering if there is a way to track down what is doing this so I can disable it. Below ...
4
votes
3answers
2k views

Generic exit function for iTerm2

I've recently begun to use iTerm2 instead of the macOS Terminal application and I'm really happy with it. I'm very used to use to exit command to close the instance that currently has focus. With ...
0
votes
1answer
107 views

What am I doing that causes zsh to silently change to vi mode?

I'm a software developer, and as such I frequently use Terminal.app. I've been using it for years. At some point in the last week or two, I started encountering this problem somewhat frequently; I've ...
1
vote
1answer
3k views

How can I change my font and coloring in Oh My Zsh to match a theme I want

I'm using Oh My Zsh and I was using the "Agnoster" theme for a while, but now I want to switch to "Amuse". So I went into my ~/.zshrc file and changed the theme config line to ZSH_THEME=amuse This ...
11
votes
2answers
2k 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
82 views

What is the path to the global directory for binary files in MacOS?

What is the path to the global directory (for example: /usr/local/bin etc.) for binary files in macOS? The problem is that I can run the command from another user. With this command I want to start ...
4
votes
2answers
769 views

Customise iTerm sudo password prompt

Recently iTerm started showing an emoji key instead of the sexy key symbol at password prompts. It now shows this: But I don't like the ugly emoji there. I want to see (this is what it looks like ...
2
votes
1answer
186 views

Repeated Oh My Zsh brew plugin warnings

I keep seeing this warning every time I open an new shell on one of my machines: Oh My Zsh brew plugin: With the advent of their 1.0 release, Homebrew has decided to bundle the zsh completion ...
0
votes
1answer
194 views

Hotkeys don't work in zsh when $TERM is set to screen-256color

As per various other discussions I bound opt+<- to 0x1b 0x62and opt+-> to 0x1b 0x66. This works great in zsh, but not in tmux. In tmux opt+<- does jump backwords per word, but also seems to do ...
0
votes
1answer
348 views

Terminal/ZSH Problems & Permission problems

I downloaded something out of the Internet and executed it, which might could have malware. After that I deleted all of that and i opened my Terminal and it gave me this error: /Users/flawn/.zshrc:.:...
1
vote
1answer
76 views

Homebrew install package which then won't run

I've installed homebrew and used it successfully for installing and using packages before. But when I installed a packaged called "shpotify" that can be used to control spotify from the command line, ...
0
votes
3answers
605 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 ...
0
votes
2answers
359 views

Run zsh alias via automator?

I am using zsh with oh-my-zsh in iTerm on macOS. There are some aliases defined in my .zshrc I use often, like this: deploy(){ cd ~/Path/To/My/Project; build ...; rsync ...; } To execute this, I ...
1
vote
1answer
2k views

changing user prompt terminal

I am new to using macs. I was using the bash shell, but recently tried switching to using iTerm2 and zsh. Originally, it looked the way I wanted, but something changed and reformatted my shell. ...
6
votes
2answers
12k 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
1answer
164 views

Write a function in zshrc that can take a parameter and can handle flags

I usually need a chrome page opened to localhost:3000 when I am developing. So, I just run the following cmd: /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --app=http://localhost:3000 ...
2
votes
1answer
575 views

ZSH terminal displaying characters and cursor in the wrong place

When my command is long and I move the cursor through it, it jumps randomly to different places and start writing in any location of the command. I'm using OS X El Capitan (10.11.6) and have ...
1
vote
1answer
642 views

exporting LSCOLORS in .zshrc not working as expected

In my .zshrc file I am loading my color scheme using the below command: export CLICOLOR=1 export LSCOLORS=GxFxCxDxBxegedabagaced But when I load my terminal I get another color scheme. I am not sure ...
1
vote
1answer
518 views

Error with Oh My ZSH themes, ZSH_THEME="random

I get the following message after installing Oh My ZSH and changing ZSH_THEME="robbyrussel" to ZSH_THEME="random" in .zshrc. Users/me/.oh-my-zsh/oh-my-zsh.sh:source:110: no such file or directory:...
2
votes
1answer
2k views

zsh: no matches found

It seems I have some zsh misconfiguration. I use youtube-dl regular to download videos. But since a few days, I get this error youtube-dl https://www.youtube.com/watch?v=mkd6JkfI4yk zsh: no matches ...
2
votes
1answer
18k 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 ...
1
vote
1answer
884 views

tmux always modify my zsh PATH

I'd like to use tmux inside my iTerm2. and I have the following in my ~/.tmux.conf file. set-option -g default-shell /bin/zsh set-option -g default-command "/bin/zsh -c 'which reattach-to-user-...
2
votes
1answer
791 views

Powerline Theme in OSX terminal have a strange color

I configure the powerline theme on OSX like zsh vim and emacs But it has a strange colour in the ">" character How can I make the the ">" character colour match with the powerline bar
0
votes
0answers
554 views

Go2shell don't work with zsh

I recently switched to zsh from bash, and Go2Shell don't work with zsh. When I click the Go2Shell icon from Finder, the iTerm window opened but the directory is the last dir in iTerm instead of the ...
3
votes
4answers
5k views

Is there a way to list all available commands in terminal

Is there a way to list all available commands in terminal? I know linux has compgen -c is there an equivalent command for OS X? Update: The actual issue was that I was using zsh instead of bash. So ...