Zsh is a shell designed for interactive use, although it is also a powerful scripting language.

learn more… | top users | synonyms

1
vote
1answer
15 views

.zshrc doesn't export variable for anaconda

I installed Anaconda Python on my Mac today and following line was added to .bash_profile by Anaconda. Since I am using zsh so I moved this line to .zshrc. However, it doesn't work properly even if I ...
2
votes
1answer
14 views

How to save user made zsh shell functions and aliases

Shell beginner here! I'd like to create aliases and functions in zsh shell to speed up my workflow. For example: tw() { open -a //Applications/Textwrangler.app "$*"; } The function itself works, ...
1
vote
2answers
21 views

Should I ignore .bash_rc, .bash_profile etc if I'm using Zsh?

Zsh configs go into the ~/.zshrc file. That’s where I’ve been putting my aliases, etc… But I want to know if I should be ignoring .bash_profile and those other files, and putting everything into the ...
1
vote
2answers
35 views

How to make Zsh not store failed command

Problem I'm using oh-my-zsh and Antigen to manage my Zsh. Sometimes I will accidentally enter a wrong/failed command into Zsh and it is very annoying when the zsh-autosuggestions plugin throws up ...
1
vote
1answer
17 views

Some characters in zsh don't show until the key is released

When inputting specific characters in zsh shell (in my case e and ;) they don't show up immediately after pressing the key. Instead they only show up a short time after releasing the key. When these ...
1
vote
1answer
20 views

How can echo the previous command I ran to a file?

I tried running echo '$(!!:p)' > /tmp/tmptxt.txt, however I just get $(!!:p). The previous command may have unescaped characters so I i need to escape it.
1
vote
1answer
17 views

How to make zsh always show environment variable name instead of the path?

I have an environment variable set to my projects folder like this: PROJ=$HOME/projects When I want to open a project folder i just type PROJ/project_name and the shell opens the directory and my ...
0
votes
0answers
17 views

Readline stops working randomly

For some reason every 1-3 hours (depending on work load) my shell read command stops accepting input and hitting return renders the ^M character. Something like: Continue? After answering: ...
2
votes
2answers
35 views

Setting the variable $USERNAME has no effect

Setting the variable USERNAME has no effect. Accessing the variable always returns the current logged in user. james@localhost:~$ USERNAME=foo james@localhost:~$ echo $USERNAME james I could not ...
0
votes
1answer
24 views

How to create a command shortcut in BASH or ZSHRC shells?

I know how to create an alias or a PATH however those are both used to navigate folders. How would you create a shortcut to say quickly type the following commands every time? alog = tail -f ...
2
votes
2answers
36 views

How do I signify repetition in a ZMV regex?

I'm trying to manually pull the digests off of Rails assets (don't ask). I was directed to ZMV for easy regex-based find/replace. But the normal {32} syntax for specifying an amount of repetition does ...
0
votes
1answer
11 views

Get word at cursor in zsh function

I'm trying to set up some fancy zle completion that requires passing the word at point to a subprocess. Zsh obviously knows about the current word/token/directory, and I can see how to bind things ...
1
vote
2answers
32 views

ZSH PS1 adding spacing when tabbing

I'm having an issue with zsh/oh-my-zsh with my custom PS1 prompt (that I brought across from bash). When I use the built-in zsh/oh-my-zsh prompt and tab for auto-completion, this works as expected. ...
3
votes
1answer
271 views

ZSH+gnome-terminal and VI input mode: Show ibeam or block cursor

Different methods exist to show if you're in insert or normal when using VI key binding in ZSH. Gnome-terminal also allows you to change the caret from block █ to ibeam | with a call to gconftool-2. ...
2
votes
2answers
47 views

Set urxvt shell without chsh?

I want to use bash as my default shell (so that it's simpler in tty) but I want to use zsh when I'm in X using urxvt. Is there a way to do this?
1
vote
1answer
35 views

Execute a program in tmux without scrolling

I use tmux (with zsh, if that helps). I have a pretty good setup, but often I find myself running a program with a lot of output, and then entering copy mode and reverse searching for the line I typed ...
0
votes
1answer
22 views

zsh completion for all executables in path

I have written a script which itself takes as an argument any arbitrary executable in my $PATH. Is there a way to create a zsh (or bash) completion function such that I would be able to type myFunc ...
1
vote
0answers
22 views

Starting Zsh in ConEmu in specified directory

ConEmu runs zsh under CygWin fine. I want to add a right click option to explorer to "Start ConEmu With CygWin Zsh In This Diretory" ConEmu provides an Integration settings page to set explorer ...
0
votes
1answer
19 views

Stop `exit` from running

When I run terminal within Pathfinder, typing exit is just a mistake (blocks the Window for nothing). How may I Figure out I'm in Pathfinder Suppress exit in Zshell if I am in Pathfinder?
5
votes
2answers
218 views

What's the differences between all the shells, zsh, bash, csh…, why are there so many? [closed]

My understanding of shell is an interpreter between me and the OS. So it will translate my command and call the right program to perform it. For this simple task, why there're so many shells existing? ...
2
votes
0answers
20 views

zsh complete cd with two arguments

Context for those who know about zsh completion but not all its features: One of the unique and really useful features of zsh is as follows: [/usr/dir1/dir2/dir3/]$ cd dir1 dirnew ...
0
votes
1answer
66 views

Where is the .zshrc file on Mac?

I’m using iTerm and wanted to customize the look of my terminal window using Oh My ZSH!. And according to the documentation I need to change the ~/.zshrc file and add a ZSH_THEME value: Once you ...
2
votes
1answer
18 views

How can I swap patterns in filenames?

I have a folder of files with names like thing.y.big.png thing.y.small.png thing.xxx.big.png thing.xxx.small.png and I would like to rename them so that the 2nd and 3rd "fields" are swapped. In the ...
0
votes
1answer
84 views

Running .bat file in zsh (in Windows)

On a Windows machine I want to avoid using cmd.exe at all cost. I'm trying to use babun (mintty 1.1.3) to run a batch file in a Windows folder. This works: { ~ } » ./file.bat -o /path/to/files.xml ...
1
vote
2answers
37 views

Is there a way to have sh/bash/zsh “case” use a variable for a test value?

I'd like to have something like the following: #!/bin/sh # ... other stuff ... # some relatively static possibilities (srsp): srsp='this|or|that|the|other' # more other stuff case $something in ...
0
votes
0answers
15 views

How to match zsh full history when reverse searching?

I wanted to execute a command from a couple of days ago so I used ctrl-R to search for it. I could only see very recent entries. I checked the history file for the command and it was there, several ...
1
vote
1answer
12 views

zsh: set option for a single command

Can I set a zsh option (like extendedglob) for a single command? Something like: setopt extendedglob param="${foo%%[0-9]##}" With the command used above, I believe enclosing in () would not be a ...
0
votes
1answer
36 views

Can't find executable (pipsi) in my PATH even though my PATH is set correctly and permissions are also correct in ZSH

I have just installed pipsi. I'm on Mac OS X Yosemite and I'm using iTerm and running zsh via oh-my-zsh. My problem is that I get the following: ~ >>> pipsi zsh: command not found: pipsi ...
0
votes
1answer
28 views

How to delete all files in the folder which exists in the tar.gz archive

Typical mistake for me, is exctraction in the wrong directory. After i realize that, i want to delete all this file, and extract again. But how to automate this delete-all-this-crap operation? Any ...
0
votes
0answers
44 views

Zsh - dnf autocompletion

Since Fedora will use dnf as default package manager in its next release, is there available autocompletion for zsh/oh-my-zsh/zpretzo? If not, is there somebody willing to do it? :D
0
votes
1answer
31 views

Zsh prompt's history number sometimes increments after ignored commands

When displaying the history number of the next command in zsh's prompt (I'm on version 5.0.2), it is unexpectedly incremented after ignored histignorespace and histnostore commands (and then only ...
1
vote
2answers
34 views

Iterating over inline array in zsh

I'm trying to figure out how to do a command to multiple items. For example: mycommmand fileA; mycommand fileB; mycommand fileC; I can do it like this: files=(fileA fileB fileC) for fl in $files; ...
0
votes
2answers
30 views

PHPStorm Built in Terminal - How do I backspace words?

I love PHPStorm's built in terminal, all my zsh aliases work properly and it's super convenient. The only thing it's missing is the ability to backspace by words (like I can in OSX's default ...
0
votes
1answer
22 views

zsh: Ubuntu like prompt for helping installing software

I run xubuntu and am switching from bash to zsh as the default shell. It works great - only thing I miss from the bash days is this: when I execute a command which isn't installed, bash would tell me ...
1
vote
1answer
132 views

oh-my-zsh (terminal) how to change prefix & suffix of new prompt window

Installed on my Mac running Yosemite is a few packages to make life in the terminal (iTerm 2) a bit better. I have oh-my-zsh (only plugin I have id antigen for oh-my-zsh) along with oh-my-git ...
0
votes
1answer
47 views

Zsh alias complex string quote escaping

I am trying to define an alias (alias gsl="...") for the following command, but can't get the escaped quotes right. git stash list | awk -F: '{ print "\n\n\n\n"; print $0; print "\n\n"; system("git ...
1
vote
1answer
32 views

How to see old history in zsh

I am using zsh with Prezto, my question is why I only see a limit number of my history: ~ >>> history2651 git checkout -- modules/prompt/functions/prompt_sorin_setup 2652 git diff ...
0
votes
2answers
23 views

Executing control statements in zsh?

This feels like a dumb question but I'm on a mac using iterm with zsh and I've been reading the zsh manual and am trying to execute ^Xh to query the completion parameters, but whenever I do ls ^Xh ...
0
votes
1answer
27 views

How can I make shell autocomplete the beginning of a filepath?

I have a project with a deeply nested folder structure. Most of the time I know the name of the file I want to work with, but the folder path is too long/complicated to type when I want to edit it, ...
0
votes
0answers
15 views

Can't use numbers and similar keys (0-9, -, etc.) in zsh without pressing fn?

Running zsh on a macbook air. Everything used to work normally until this morning - I don't even think zsh updated or anything like that. I can't type numbers, -, ., or / without holding fn. It does ...
0
votes
0answers
19 views

Is it possible to reuse functions I defined in .bashrc from zsh?

I am using bash on my Mac and I spent a lot of time customising functions in there. One things stops me from adopting zsh fully on Mac: I am not that proficient in zsh so I am pretty sure I can ...
0
votes
1answer
224 views

iTerm/zsh not reading .bashrc OR .bash_profile

In ~/.bash_profile I have : if [ -f ~/.bashrc ]; then source ~/.bashrc fi In ~/.bashrc I have some aliases When I load a new iTerm window, my aliases do not work. If I source ~/.bashrc they ...
0
votes
1answer
14 views

Alias options in zsh

When using the zsh alias command, what does the -s flag do (for example, lines 83-87 of oh-my-zsh's common-alias plugin?
1
vote
0answers
42 views

How to change default shell for a network user?

I am working with Ubuntu and I would like to change my default shell to z shell. I cannot use the chsh -s /bin/zsh or chsh-s /bin/sh myuser command since my user name does not exist in /etc/passwd and ...
2
votes
1answer
23 views

Zsh auto completion from man page

I noticed that fish has a feature to auto update auto completion scripts from man page. Does zsh have a similar script to do this?
1
vote
1answer
32 views

Is it possible to 'source' the output of a python script

I have a large python codebase that knows a lot about my working environment. I would like to use it to set up my ZSH session when i open a terminal window. The python script would output text that ...
0
votes
1answer
32 views

how to migrate bash prompt \#/\! to zsh

My bash prompt currently starts with the following variables : \#/\! which means \# The command number of this command. \! The history number of this command. So \# is specific to each ...
2
votes
2answers
138 views

How to delete old $PATH echo in Mac

After i changed my Mac username(using the way supplied by Apple Documents), I found that when echo $PATH, there are some old paths in it. ...
1
vote
1answer
83 views

Screen window title using zsh

I would like to make vim screen tabs name more useful. I've turned on the screen plugin, and tried several approachs. One that I would enjoy most was to make the screen name fixed using another load ...
3
votes
1answer
31 views

reload all running zsh instances

I typically have on the order of a dozen zsh processes running. When I edit my config files, I'd like a clean way to get them all to re-initialize. Ideally, this would not mean completely killing them ...