Questions tagged [zsh]

Zsh or Z Shell is a Unix shell

Filter by
Sorted by
Tagged with
1
vote
0answers
48 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
12 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
91 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
788 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
145 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
41 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. ...
1
vote
1answer
137 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 ...
1
vote
0answers
52 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
187 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
42 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
83 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
421 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
34 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
78 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
79 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
94 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
493 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
83 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
76 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
353 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 ...
106
votes
4answers
22k 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
92 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=...
3
votes
1answer
296 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
127 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
82 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 ...
6
votes
3answers
8k 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
155 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
742 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
22 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?
-1
votes
2answers
1k 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
40 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
892 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
166 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
348 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
906 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
105 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
138 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
128 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
203 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
4k 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 ...
13
votes
2answers
3k 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
141 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
852 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
211 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
220 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
464 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:.:...