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

learn more… | top users | synonyms

0
votes
1answer
23 views

Is there a zsh add-on or an iTerm addon that allows arbitrary string autocompletions?

I often find myself staring at a string that was printed in my terminal, I need to use it in a command, but don't want to move the mouse to copy/paste it. I'm wondering if zsh or iTerm support ...
2
votes
1answer
47 views

zsh: What does hist_find_no_dups mean?

HIST_FIND_NO_DUPS When searching for history entries in the line editor, do not display duplicates of a line previously found, even if the duplicates are not contiguous. However, ...
5
votes
4answers
3k views

ALT+arrow moving between words in zsh and iTerm2

I logged in on one of hosting provider servers and noticed ALT + left and ALT + right moved between words in a shell prompt in GNU Screen. What kind of key bindings I need to configure and where to ...
38
votes
7answers
42k views

How can I do a recursive find and replace from the command line?

Using a shell like bash or zshell, how can I do a recursive 'find and replace'? In other words, I want to replace every occurrence of 'foo' with 'bar' in all files in this directory and its ...
7
votes
2answers
3k views

Why is a percent sign appearing before each prompt on zsh in Windows?

I'm getting zsh set up in Windows and I'm getting a reverse (black on white (black terminal background)) percent symbol in the first character position in the line just above every prompt. Usually ...
3
votes
1answer
47 views

for breaks script execution in ZSH

I feel dumb. I have a ZSH script with eg two file loops, eg: for f (*aaa*) {echo "$f"} for f (*bbb*) {echo "$f"} The script exits if the first find does not find matching files. I need the script ...
17
votes
3answers
7k views

How can I do Ctrl-Z and bg in one keypress to make process continue in background?

I follow this pattern of suspending the task and then letting it to continue too often with the Ctrl-Z bg sequence. I was wondering is there any way to compress that to single keypress? My shell is ...
0
votes
0answers
50 views

Oh-My-Zsh doesn't appear to see the path

so I am attempting to use my path variable to find a file but it doesn't work. I am using zsh (oh-my-zsh particularly) And i have the following commands in my .zshrc export ...
0
votes
1answer
26 views

Null key mappings in console vim on OS X

Running in zsh on Mac OS X's Terminal.app. The following 2 keybindings do work in MacVim, but not console vim (7.4) inoremap <c-space> <c-x><c-o> inoremap <c-@> ...
1
vote
2answers
97 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
176 views

OS X El Capitan 10.11 Terminal 2.6 won't open new tabs with same working directory

I am using the default settings for Terminal, but when I create a new tab my working directory is always set to my home folder instead of the current working directory of the previous tab. Here's an ...
0
votes
1answer
26 views

Adding Scala to the PATH in zsh

I've been at this for a while and I think I'm starting to go crazy I have downloaded Scala to ~/bin for easy access on my Elementary machine; but I seem to have some difficulty adding it to the PATH. ...
28
votes
9answers
11k views

Open a new tab in the same directory

Say you are in /very/cool/and/deeply/nested/folder . And you want to open a new terminal tab in the same folder. How would you do that? I use Mac OS and Zsh.
0
votes
1answer
104 views

Why does iTerm2 print out 1 at start?

my problem is that iTerm print out the 1 value on my zsh when i open it i can't figure it out why. I've checked the advanced setting in my profile configuration but it seems that nothing is added ...
0
votes
1answer
89 views

No such file or directory .zshrc

Recently, I realized I haven't been able to run . .zshrc in my home directory. It gives me the error above. It's really strange and it's bugging me out since it's worked perfectly fine in the past. ...
8
votes
2answers
6k views

Shell SIGKILL Keybinding

How can I setup a keybinding to send a SIGKILL to the current foreground job? I already know that Ctrl+C is SIGINT and Ctrl+\ is SIGQUIT. I would like a more severe option. Is there anything ...
0
votes
1answer
33 views

command substitution before ssh

I want to write the results from a job into a remote file on another host in my cluster. I know I can do this: echo 'My text' | ssh me@my.host "cat >> ~/my.output" which will append 'My text' ...
1
vote
1answer
47 views

ZSH: change prompt just before command is run

I would like to have a two-line prompt in zsh, but collapse it to a very small one just after pressing ENTER, so that it doesn't show up in the terminal scroll history. After typing two commands, the ...
0
votes
0answers
85 views

Proxy stack configuration for KDE and ZSH

I have the following stack: Ubuntu 14.04 ZSH KDE Firefox Chrome PyCharm/other GUI applications ssh/git/wget/curl/etc from terminal And I'm behind a proxy server, http:proxy.server.com. I set up ...
0
votes
0answers
14 views

Which library implements the NO_PROXY variable?

Which library implements and passes to the network stack the NO_PROXY variable? Considering that is being read from a shell (ZSH, bash) or other programs. Is it just a variable that other programs ...
17
votes
2answers
8k views

Command history in zsh

Currently I have zsh set up in such a way that command history is shared between all sessions immediately. Say I have a terminal emulator open with two tabs, each with a zsh session, A1 and A2. If I ...
0
votes
1answer
27 views

Resuming a job with 'r' in ZSH

I run Vim in zsh. And I often need to check something else in the terminal. So I just quickly suspend the editor by pressing Ctrl+Z and then type fg to get back. Today, by chance, I noticed that the ...
30
votes
6answers
24k views

zsh with Cygwin

How can I configure zsh to be the default shell under Cygwin?
59
votes
5answers
26k views

Zsh not hitting ~/.profile

I've just installed zsh on my Ubuntu system. It seems zsh isn't executing ~/.profile on init. To my best understanding, this should be an automatic behavior. What am I missing?
15
votes
3answers
2k views

Separate up arrow lookback for local and global ZSH history

Is it possible to... Step up local ZSH shell history (actions only happened in that prompt) Step up global ZSH history (shared history is on) - default what happens when you press UP arrow when ...
0
votes
1answer
37 views

zsh: command issued gets repeated in output

I'm having an issue identical to: Repeated command in output for zsh prompt. As in, the command I execute is being repeated on the next line, and then the output of the command follows. But ...
69
votes
7answers
36k views

How can I make tmux use my default shell?

On a new setup, tmux is using bash instead of my default (zsh). How can I force it to use zsh?
0
votes
1answer
49 views

Delete files if condition is met

I have the following directory tree: /Directories/ /Directories/somedir/somefile.mkv /Directories/somefile.rar I'm trying to find a way to delete the .rar file if the .mkv file exists and is larger ...
7
votes
3answers
2k views

How can I make zsh completion behave like Bash completion?

I switched to zsh, but I dislike the completion. If I have 20 files, each with a shared prefix, on pressing tab, zsh will fully complete the first file, then continue going through the list with each ...
6
votes
4answers
3k views

Problem with Ctrl-Left/Right bindings in oh-my-zsh

For some reason I am unable to bind Ctrl-Left Arrow and Ctrl-Right Arrow to move between words in ZSH after installing oh-my-zsh on my MacBook Pro. In iTerm2 I have my keybindings configured to "Send ...
3
votes
3answers
192 views

Locating the source of a function in zsh

I have this annoying issue in my zsh shell where a function is being declared somewhere and that function is named "cp" so it's overriding the normal cp behavior. I'm trying to locate the function ...
0
votes
1answer
29 views

Setting up an alias in zsh, storing additional information

I am trying to build a triplet of aliases in zsh. jc, g1, g2, jc arg1 arg2 would be the same as the command cp -r arg1 arg2 And g1 is the same as cd arg1 and g2 is the same as cd arg2 The ...
2
votes
2answers
109 views

Rename selfdefined function

Having a precmd() that does quite a lot, like checking for VCS information, I want to disable it when I'm navigating on slow mounted network drives. I came up with the following with which I can say ...
3
votes
1answer
936 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, ...
6
votes
4answers
2k views

OS X 10.11 (El Capitan) Making Zsh Very Slow

I just freshly installed El Capitan on my MacBook Pro. I had trouble earlier with the my terminal being too slow while typing in simple commands. I thought it might have been that I need to format my ...
0
votes
0answers
64 views

Is it possible to use ZSH-style completion in IPython?

In IPython, if I trigger a completion in an ambiguous context, for example var = [press TAB] then I got a whole screen of completion candidates. I have to scroll up to find out what I did before. ...
3
votes
2answers
279 views

How can I scroll up one line in zsh?

I'm using iTerm2 w/ bash and I scroll up through the history buffer one line by typing Shift+Up. When I switch to my zsh shell, it just inputs 2A. How can I scroll up a single line in zsh w/ just my ...
0
votes
0answers
31 views

Specifying Path With Escapes in an Environment Variable

This is a shell escaping syntax, cmake, and perhaps Haskell issue (not sure where to fix it). Specifically, I am in Cygwin and trying to execute something like: CXX=/different/g++ ./build_all.sh ...
0
votes
1answer
109 views

ZSH in iTerm2: Why my prompt can only use 8 colors?

I am trying to set a color prompt in ZSH ($TERM=xterm-256color), but it can only get 8 colors out: Only the bright version of the colors. This is only the case for prompt, while the other applications ...
0
votes
1answer
40 views

tmux exits with [exited] on Ubuntu 14.04

The machine is a VPS that I SSH into. The problem started when I installed Prezto tmux -v also exits with [exited] sudo tmux doesn't work either I don't have a .tmux.conf I seem to have a ...
0
votes
0answers
208 views

Why oh-my-zsh is that slow?

I am quite familiar with bash, but I would like to give a try to zsh. Lot of people told me to try oh-my-zsh. After the installation I get a unreadable prompt and when I eventually find an ...
0
votes
0answers
72 views

Error Resolving User Permissions + Zsh Command Not Found

This is the list of user permissions after logging them to the terminal: ➜ ~ ls -ld / /usr /usr/bin /usr/bin/manpath drwxr-xr-x 33 root wheel 1190 Nov 14 08:49 / drwxr-xr-x@ 11 root wheel ...
32
votes
4answers
6k views

zsh (z shell) numpad/numlock doesn't work

I just upgraded to zsh/oh-my-zsh. Almost immediately I notice on my machine that the 10-digit numpad is not working. It was working in bash and fish shell. Oddly, if I hold down the fn/function key ...
0
votes
1answer
224 views

shell environment setup for virtualenv/virtualenvwrapper

The question is about shell setup for virtualenvwrapper, an extension to virtualenv (python guide). Similar questions had been asked many times but with a lot with different answers: Environment ...
1
vote
1answer
48 views

zsh completion functions without separate underscore file?

I'm trying to learn how to write completion functions and initially I want to avoid a proliferation of separate files for separate customizations (I already have enough and I don't want more). Is ...
0
votes
2answers
306 views

Command Line: z is installed but can't find the command

I recently installed iTerm2 and ZSH (with oh-my-zsh) after some months of very light usage of the stock Terminal on Mac OS. I heard of a tool called "z" and installed it via brew with brew install ...
1
vote
0answers
35 views

How to properly match newline with zsh regex?

for my prompt i am trying to parse the current git branch out of the resulting text of the git status command. For example, it returns: On branch master nothing to commit, working directory clean ...
1
vote
1answer
129 views

Keep color in less after make and pipe

I would like to keep color in less command after using "make 2>&1" to compile some program. There are similar topics with "grep" and "ls" commands but solutions do not work with this command. For ...
1
vote
0answers
56 views

Dynamic Zsh auto-completions

I'm trying to write completion functions for some custom functions I wrote, but seem to be really struggling with even the most basic ones. An example function is: function eb_instances() { if ...
2
votes
1answer
95 views

Why doesn't zsh autoload work in a script?

I am trying to get to grips with autoloading functions in zsh. I have added the folder in which I'm storing my functions (~/.zfuncs) to my fpath, and I've added a test function # ~/.zfuncs/myfunction ...