Zsh is a shell with many advanced command-line and scripting features.

learn more… | top users | synonyms (1)

19
votes
0answers
627 views

How to combine zsh autocomplete for wrapper function arguments and existing command

I work mostly in gvim and many terminals. Originally, I preferred to open all my files in a single vim instance. To that end I used an alias to open files from my terminals in the current 'vim ...
11
votes
0answers
1k views

git completion with zsh: filenames with spaces aren't being escaped properly

Git completion: I'm having difficulty with git's filename autocompletions on my system. I'm using zsh (5.0.5) with git (1.9.3) on OS X (10.9.3). Both zsh and git have been installed via homebrew. ...
5
votes
0answers
102 views

How to make zsh correct remember my decision

I have enabled correction (I wouldn't call it autocorrection specifically because of this issue) in zsh by enabling setopt correct in my .zshrc. Now, when I type dtae in a terminal, I get: dtae ...
5
votes
0answers
527 views

Change Zsh theme in Android Studio

I've recently jumped ship to zsh and I'm using the Oh my Zsh! theme blinks. It looks very nice in the OSX Terminal, but it looks very bad in Android Studio's terminal. So my question is is there a ...
3
votes
0answers
20 views

How can I use a key other than <ENTER> to exit zsh's completion menu/widget?

Like alot of zsh users I have completion configured so that when I am at a command prompt and I invoke completion a menu appears that can be navigated with the directional arrow keys. i.e. in my ...
3
votes
0answers
46 views

Calling zsh completion function and obtaining its results

I'm trying to make use of zsh's completion widgets in my own scripts. At one point I'd like have access to the result of every completion that is active in zsh, or rather I want to obtain the final ...
3
votes
0answers
64 views

No zsh-syntax-highlighting within tmux

I experience proper zsh-syntax-highlighting (see here) when first opening a shell session, but as soon as I enter tmux, the syntax highlighting no longer appears. I found this Github issue ...
3
votes
0answers
26 views

How do I write a custom filename completer for specific directories in zsh?

I've found that file names with dates before the title are difficult to tab-completion. I'd like to write custom completion functions for these directories. How do I specify that the completer should ...
3
votes
0answers
69 views

Suspend a process silently with ctrl-z

With my current workflow, I frequently use CTRL-z to suspend Vim so I can enter a quick few commands before resuming editing my code with fg (actually, it's CTRL-z again, thanks to the handy ZSH tip ...
3
votes
0answers
180 views

Call vared and complete files from a different directory

I have the following zsh function which lets me edit symbolic links using the vared ZLE builtin. function lned { emulate zsh setopt err_return extended_glob local_options local_traps local -a ...
3
votes
0answers
229 views

Git completions for aliases only available after running `git reflog`

I have a few aliases that I want to autocomplete for git, e.g., the following alias gco="git checkout" When I was attempting to add completions for this alias, I looked around in my path and saw ...
3
votes
0answers
239 views

Is there a postexec/predisplay hook for ZSH?

I know zsh has a preexec hook that fires before the command is executed, but is there one that fires after the command has been initiated but before the output is displayed to the screen? I ask ...
3
votes
0answers
361 views

Physical Terminal (DEC VT220) issues with ZSH

I recently purchased a VT220 and all the hardware necessary to hook it to my macbook pro. After several hours of fiddling I got it working with a shell - my only problem is my shell of choice, ZSH, ...
2
votes
0answers
20 views

On using $hash_array[$(global_alias)]

Identical code works on one system, fails on another: % zsh --version zsh 5.0.7 (x86_64-pc-linux-gnu) % typeset -A frobozz % alias -g foo='echo xyz' % frobozz[$(foo)]=9 % echo ${(kv)frobozz} xyz 9 ...
2
votes
0answers
45 views

How to avoid namespace collisions/pollution in a script meant to be sourced?

I want to implement a script foo.sh that culminates in the an execution of a command bar (with some arguments). The command bar modifies the current shell environment, which means that foo.sh must be ...
2
votes
0answers
203 views

How can I make my Zsh theme (“fade”) look good in urxvt?

I am using Arch Linux and as a newbie I don't have any preference for a terminal emulator yet. Since rxvt-unicode seems to be the most popular one, I thought I'd try that first. I'm configuring it ...
2
votes
0answers
29 views

How to view current settings for all options?

I know that setopt with arguments will show the options that are set to values different from the default; e.g. % setopt interactive login monitor norcs shinstdin zle If you have memorized all the ...
2
votes
0answers
141 views

How to setup zkbd (zsh keyboard bindings) in a server?

I have zsh shell in a Linux server, and connect to the server from screen sessions in different computers. I'm trying to get control keys, such as home and end, to function correctly. Because zsh ...
2
votes
0answers
335 views

Making zsh filename completion case-insensitive everywhere

I have the following line in my zshrc to make filename completions case-insensitive: zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' This works most of the time but I’ve noticed that if I ...
2
votes
0answers
75 views

Why does select-word-style stop me from using backward-kill-word for leading whitespace?

If I have just some whitespace at be beginning of my zsh prompt, I can usually ^W (backward-kill-word) it away. However, as soon as I load select-word-style - even if I don't select any special style ...
2
votes
0answers
144 views

How can you get the current terminal line (the one that is still editable by the user)?

I need a way to use the current line which the users typed into as variable for a shell function. my current code, which can be called by ctrl+r zle -N search bindkey "^R" search search () { read ...
2
votes
0answers
166 views

Corrupt files after extracting with Cygwin's GNU tar

I have a bunch of tarball backups which I just restored onto my new Windows 8.1 + Cygwin system using GNU tar: zsh$ for file in **/*.tgz; do tar xvzf $file; done To my surprise a lot of these ...
2
votes
0answers
42 views

Manual tab completions in zsh

I would like nm[TAB] to expand to node_modules in zsh. Is this possible? How can it be done? Ideally, it wouldn't be triggered if there is another completion available, such as an already existing nm ...
2
votes
0answers
73 views

ZSH and completion of files with newline characters

I am experimenting with ZSH on nasty file names, especially file names with the newline character in it. Here is how I create them: $ touch "filename<hit return here> 1" $ touch ...
2
votes
0answers
160 views

zsh: Echoing every statement?

I have an odd problem with zsh when I switch between shells in a particular way: Option 1 (works well): I start a zsh shell. I switch to tcsh with /bin/tcsh, and I switch back to zsh with /bin/zsh ...
2
votes
0answers
36 views

Make zkbd ignore $DISPLAY

Is it possible to make zkbd ignore $DISPLAY variable? I have set up when I log in to different X sessions and it is annoying if suddenly I need to reenter/copy configuration (and I have no idea why ...
1
vote
0answers
15 views

Can I get zsh to include the directory stack in tab completion for tilde (~)?

I have autocd, autopushd and pushdminus enabled. When I try tab completion with ~: $ ~<Tab> avahi ftp mail redsocks systemd-coredump systemd-timesync bin gdm nm-openvpn ...
1
vote
0answers
26 views

Disable Oh-My-ZSH Completion of Beginning of Filename

I'm starting to use the directory stack in ZSH, but I've run into a problem. In an ideal directory, typing cd -<TAB> gives me the output of dirs -v. However, in some others (i.e. my Downloads ...
1
vote
0answers
31 views

Issue in activating environment on UAT server

I was working on a script that logs in to UAT server, reroute to necessary folder and activates the virtual environment. Following is the script: function gotouat(){ branch=`getBranchName`; ...
1
vote
0answers
23 views

How to have full completion in a run application dialog?

I've configured XFCE to execute gmrun as run dialog (Alt-F2). It works great with completion on commands but does not propose completion on arguments. How to set up a run dialog with full bash/zsh ...
1
vote
0answers
20 views

highlighting of zsh correction

When zsh's autocorrection suggests a change in long filename, it may be hard to spot which change is actually suggested: The example is of cause artificial as tab completion would've done the job ...
1
vote
0answers
33 views

Can I prevent zsh slowing with a large history?

I've just migrated from bash to zsh. I converted ~/.bash_history for use in zsh. It's 150 000 lines long. bash is almost instantaneous to start up, but zsh is now fairly slow, taking half a second to ...
1
vote
0answers
30 views

tmux start process if not already running

In my .zshrc, I have a bit of logic that will automatically start a tmux session or, if sessions are already running, prompt to attach to one of them or create a new one and attach to that. This all ...
1
vote
0answers
32 views

`ls\` logs out of terminal session?

Like many, I have an alias ll=ls -l[.]+ set. A moment ago, I typed ll and then accidentally hit \ on the way to return. I hit return again to finish the command (on the continued line prompt), ...
1
vote
0answers
10 views

Global [multiple sessions] directory stack

For the current zsh session I use dirs -v command to print the directory stack. I'd like to have an analogous tool that shows me the directory stack of all sessions, also the closed ones. Or if not a ...
1
vote
0answers
192 views

Byobu - New window with same ssh session?

Is there a way to configure Byobu to use same ssh session in a new window. For e.g. Open Byobu window ssh into a remote host Press 'F2' to open a new window. This opens the terminal with ...
1
vote
0answers
27 views

Is there a better to find out the script location which is part of a zprezto module?

I am writing a custom module to extend the zprezto framework for myself. The goal is to be able to start a tmux with proper configuration by name. Here is the code of the init.zsh of my custom module: ...
1
vote
0answers
51 views

How can I complete a -N numeric parameter?

I'm writing an autocomplete script for supervisorctl. Is it possible to complete a numeric parameter such as -6, -999 etc? Currently my call to _arguments looks like, which doesn't work: _arguments ...
1
vote
0answers
32 views

autojump : favor folders that share the most parents with current directory

Say I have following folders hierarchies : /home/kray/virtualenv/dev1/myproj/bin /home/kray/virtualenv/dev2/myproj/bin And i type in a console: $ pwd ...
1
vote
0answers
251 views

Powerline bash prompt not colorized in tmux

The bash/zsh commandline prompt is not displaying colors in tmux, even though I managed to get the powerline itself working (with colors). The prompt works fine in pure bash/zsh. I am getting the ...
1
vote
0answers
120 views

Bash script for opening screens and compiling the same file

I have written a bash script to initiate separate screen sessions and run a command in each of them that compiles the same C++ source file in ROOT (an object-oriented data analysis framework ...
1
vote
0answers
401 views

zsh/Prezto: difficulties with right prompt alignment

This may be stupidly simple, but... I am trying to make my own prompt for Prezto. I have been using numerous prompts for reference (I can post a list if necessary). My RPROMPT and cursor are refusing ...
1
vote
0answers
167 views

Zsh: quickly bookmark commands

I just had an idea, I'm sure it must exist though I could not find anything on the web. This topic gets close to my idea but not enough: How to quickly store and access often used commands? I'd like ...
1
vote
0answers
212 views

Navigating through the directory stack in zsh from the command line

In zsh, is there a way to navigate through the history of directories that I have visited (those listed in dirs) when I am typing a command in the command line? For example, say that I start typing ...
0
votes
0answers
13 views

Reading error output string in oh-my-zsh

I am using oh-my-zsh to automate some of the Unix tasks i do. One of the task require making a call, and if successful, echo a message. However, if there is a failure, I dont wan't to echo the success ...
0
votes
0answers
49 views

Command not found, only when used in a script

I installed pup on my mac using homebrew. When I try this command in my terminal cat index.html | pup -p 'div[class="quote"] text{}' >> quotes.txt it works fine but when I use it in a ...
0
votes
0answers
32 views

How can get the screen command to work properly?

I'm trying to work out how to use the Unix screen command. I'm using Zsh on Mac OS 10.11.3. So far, nothing is working as described. (I don't have enough reputation to link to the tutorial I'm ...
0
votes
0answers
12 views

Why is zsh seemingly ignoring no_list_beep?

I have zsh (5.1.1) on OS X (10.10.4), and am using oh-my-zsh with various plugins. When I type e.g. ls z in a directory with multiple items starting with z, zsh beeps and then displays an ...
0
votes
0answers
40 views

Set a ZSH shell variable using mintty?

I have configuration files that I use to make my PS1 fancy. The design depends on the presence of a particular font. If the font isn't present, the PS1 looks ugly. I share access to a webmaster ssh ...
0
votes
0answers
32 views

Fill the name of last-run program in Bash

Suppose I execute some command: ls -l ~/some_dir. I would like to create an alias, such that I could execute man with the name of the last-run program as a parameter, i.e., man ls in this case. ...