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

learn more… | top users | synonyms

1
vote
1answer
9 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 ...
1
vote
0answers
11 views

Can one read input into a element of a associative array? [migrated]

I want to use read to put data into a particular element of an associative array, so I wrote the following: typeset -Ag aa aa[key]='initial value' ... read aa[key] which produces an error: no ...
0
votes
0answers
5 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
6 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
18 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
15 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
6 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
25 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
13 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
15 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
18 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
38 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
14 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
14 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
1answer
16 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
25 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, ...
-2
votes
0answers
11 views

Zsh prompt function

why it's doesn't work? setopt prompt_subst autoload -U colors && colors git_prompt() { temp=`git symbolic-ref HEAD 2>/dev/null | cut -d / -f 3` if [ "$temp" != "" ]; then ...
0
votes
0answers
11 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
15 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
56 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
13 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?
0
votes
0answers
30 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
13 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?
0
votes
1answer
26 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
29 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
1answer
78 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
49 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
23 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 ...
0
votes
1answer
22 views

Bash: immediately disown job after it is started (Bash inbuilt equivalent of Z Shell's &!)

Is there a Bash equivalent of Z Shell's &! (or &|), i.e., immediately disown a job after it is started? I looked in Bash Reference Manual and searched in Google but can't seem to find anything ...
0
votes
1answer
7 views

Zsh backward-delete-word does not recognize “/” character

I want ctrl-W on Zsh to stop when it encounters the "/" character. I have the following in my .zshrc file, but it doesn't stop on "/". What is going on? default-backward-delete-word () { local ...
1
vote
1answer
20 views

Start zsh with a prompt specified on the command line

Is it possible to start an interactive zsh session with a specific prompt without modifying a configuration file? I tried things like that: zsh -c 'autoload -U prompt; prompt adam1; zsh -i' But ...
0
votes
2answers
72 views

How to draw a line between commands in zsh shell

Does anyone know how to draw lines in between the commands in zsh? Here is an example with MobaXterm:
0
votes
1answer
12 views

On MacOS setting zsh as shell using chsh does not change $SHELL

chsh -s /usr/local/bin/zsh The abover changes my default shell to ZSH, however even after starting a fresh session $SHELL is still set to /usr/local/bin/fish, my previous shell. So if I do exec ...
2
votes
0answers
36 views

focus to newly opened terminal

I am using gnome-shell 3.14 on archlinux 3.17.3-1. I have a keyboard shortcut (ctrl+alt+T) to open an xfce4-terminal. My issue is that when I triger this shortcut the focus is not set the the newly ...
3
votes
1answer
32 views

How can I get ZSH shared history to work?

I have setopt share_history and set opt inc_append_history set in my ~/.zshrc. This is almost working. In session 1, I execute a command, it's written to history. In session 2, the command is not ...
0
votes
1answer
49 views

“broken pipe” after every terminal command

I’m running Mac OS X 10.10 (Yosemite) with iTerm2 and Oh-My-Zsh. After every command I run—even if the command is successful—I receive the error “broken pipe.” How can I troubleshoot what is ...
0
votes
1answer
21 views

In zshell how do I make the command line prompt visible

My zshell command line prompt has become almost invisible, I don't know how or why, but now it's white on a very pale grey background. Can someone please give me a command, preferably a short one, ...
2
votes
1answer
73 views

Dynamic variable substitution in PATH

I want to run different versions of Java on the same machine (Linux Mint 17) with default to Java 7. So I put this into /etc/environment: JAVA_HOME="/tools/java/java7" JAVA7_HOME="/tools/java/java7" ...
1
vote
1answer
31 views

Indent execution results in zshell

I'd like to customize my zshell so that the prompt is butted up against the left border like normal. I'd also like to have all execution results indent by perhaps 2 spaces. Is there a way to indent ...
2
votes
2answers
30 views

Is there a man page for PROMPT in zsh?

I know how to look up commands with the man command. When looking at other people's .zshrc files, I see what I think are builtin variables (PROMPT, RPROMPT, etc.). Where might I learn more about ...
2
votes
2answers
40 views

How to shrink the prompt of a long path using environment variables in OS X (extend '~')

I've seen this working with the gemset environment, I would like to reproduce it now that I need to work on a very indented directory path. Basically I had a $GEM_HOME environment variable pointing ...
2
votes
1answer
33 views

How to show a caret-C in canceled command line in zsh, like bash does?

When I'm in the middle of entering a line to my shell of choice, and change my mind, I can quickly throw C-c and start afresh. Under bash it looks like this: user@machine:~$ rm everything^C ...
1
vote
1answer
21 views

ZSH custom widget not working as I think it should

I'm trying to define a function so that I can launch Midnight Commander by pressing Alt-, but the function just doesn't work. I found and modified a function on another site and modified it so: ...
0
votes
1answer
66 views

Cannot copy from Vim under Tmux into clipboard using "+p on Ubuntu

I'm using zsh, tmux, and Vim and for some reasons recently, I've noticed I cannot copy from Vim to X clipboard under tmux using "+y. Any idea how I can troubleshoot this issue? It used to work before. ...
1
vote
0answers
29 views

Zsh autocompleting cd with other people's home directories

Found this weird behavior with zsh autocompletion for cd. For some reason, if I write the prefix of a username after cd and press tab it will autocomplete to username/ and try to cd to that user's ...
1
vote
1answer
27 views

ZSH completion of long options gives short options

When trying to complete for example git difftool --cached, ZSH should complete directly, but instead if gives me a lot of short options to choose from, am I doing something wrong? My current config ...
1
vote
2answers
36 views

Alter output of every command

I'd like to know if there's any way of altering output of every command I execute in terminal. The purpose is to make the output formated for my markdown howto's. E.g. ls -la .*z #>-rw-r--r-- 1 ...
2
votes
1answer
251 views

Percent sign (%) in front of shell command

I just pasted a bunch of code into my shell, but forgot to remove the leading % before running the command. It appears to have done nothing. Why does this do nothing in my shell (zsh)? > % echo ...
0
votes
1answer
227 views

cannot run bundle using zshell, get git errors

I have oh-my-zshell installed and these are my plugins plugins=(git rails ruby coffee npm bundler) I can run npm fine, but whenever I run bundle install inside m project i get this error etching ...
0
votes
1answer
19 views

zsh git completion reports _git:4113: bad set of key/value pairs for associative array

I have installed zsh and git on SLES 11 SP2. When I try to trigger an auto complete for a git command I get the following error message: zsh git completion reports _git:4113: This is my .zshrc # ...