Tagged Questions

Many of the useful features of bash, ksh, and tcsh were incorporated into zsh; many original features were added.

learn more… | top users | synonyms

2
votes
0answers
14 views

Adding a trigger command to autocomplete function in zsh

When you define an alias like alias g=git, the shell will pick it up and run the corresponding autocomplete function. Now, there's a program out there called hub, which is basically a supserset of ...
1
vote
1answer
36 views

Cygwin + zsh: Home and End keys not working

I cannot get Home and End keys to work for zsh under Cygwin. Various sources seem to suggest that bindkey '\e[1~' beginning-of-line bindkey '\e[4~' end-of-line will fix the problem but this does ...
0
votes
1answer
24 views

iTerm2 zsh oh-my-zsh open tab with same directory

Hi i just installed iTerm2 and tried to open a tab with the same directory as the tab that open it. I tried Zsh: Open a new tab in the same directory answer but still can't get the directory ...
2
votes
1answer
21 views

Per directory shell customisation

Is it possible to source a shell file when entering a directory, and unsource it when I leave? Ie certain project directories would be really useful to autoload some command aliases, but only in that ...
0
votes
1answer
20 views

In OS X Lion under zsh, how can I set up a /Users/username/tmp directory which deletes after X days?

I'm new to scripting and regular jobs on OS X, so appreciate the help in advance. I'm looking to have a tmp directory in my homedir, as in /Users/username/tmp which I can use as my "downloads" ...
3
votes
1answer
59 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 ...
0
votes
0answers
28 views

How does the .profile file work if I fork a process?

Lets say I open vlc or gimp on startup, but those commands don't return until the program closes. Does it just let a bash interpreter run indefinitely until they close or does it run and immediately ...
2
votes
2answers
78 views

What happens under the hood when I run a command line program in another programming language?

Some programming languages have system() exec() calls where I can run commands. What exactly happens when I do that? If I run system("ls") Does it run a bash interpreter on the string? Does it make an ...
2
votes
1answer
12 views

How can I filter zsh's completion candidates?

I'm trying to autocomplete an OS X defaults domain. I type: $ defaults write <TAB> And I get lot of results, as you might imagine: com.apple.AOSNotification.Accounts com.apple.ATS ...
2
votes
1answer
25 views

Better way to read a line of user input in zsh? (e.g. with zle?)

Zsh's read for some reason is echo'ing ^M's instead of accepting them as <Enter> keystrokes. (If -d is set, then they are recognized as <Enter>'s, but still echoed.) It also doesn't ...
1
vote
2answers
64 views

ALT+arrow moving between words in ZSH and iTerm 2

I logged in on one of hosting provider servers and noticed ALT + left and ALT + right moved between words in a shell prompt in a screen. What kind of key bindings I need to configure and where to get ...
0
votes
1answer
56 views

Vim doesn't load symlinked .vimrc

I've got a symlinked .vimrc: simont@charmander ~/repositories/config-files [master *] ± $ ls -l ~/.vimrc lrwxr-xr-x 1 simont admin 6 9 May 17:14 /Users/simont/.vimrc -> .vimrc However, vim ...
1
vote
1answer
67 views

Tmux + urxvt ghost activity notifications

Im using tmux on urxvt, I have activity monitoring turned on and i noticed that all tmux windows get an activity notification after every 10~15 seconds, when i switch to that window there is nothing. ...
1
vote
2answers
36 views

scp with zsh : no matches found

when I try scp over zsh, I get scp hostA:Descargas/debian-6.0.4-* user@192.168.1.154:Escritorio/Software/ zsh: no matches found: hostA:Descargas/debian-6.0.4-* the same command work in bash
0
votes
1answer
47 views

Advanced alias in zsh shell

I'm using the zsh shell on ArchLinux and I want to know if there's an easy way to make "advanced" aliases. Normal aliases work just fine. However I can't find a way to create an alias for a ...
2
votes
1answer
66 views

Why is my $PATH different in the executed script?

echo $PATH inside gnome terminal: ...
2
votes
1answer
78 views

oh-my-zsh history completion

I have recently switched to zsh, using robbyrussell's oh-my-zsh. Before that i used bash with a lot of custom stuff and i am only missing one thing because zsh is trying to be 'too smart': If i type ...
2
votes
1answer
46 views

can I make zsh filename completion work like Vim?

I use setopt menu_complete so that I can hit TAB repeatedly to get different filename completions in zsh. However, I would also like to be able to type: ls ~/*.txt<TAB> and then use TAB to ...
2
votes
2answers
65 views

How to echo a command then run it?

How to print a command (echo it), then run it in a single command ? This is useful when you have some alias/function and wants to print what the command is before running the command. This would be ...
0
votes
0answers
20 views

per-session zsh prompt

I've just started using tmux. Some workflows I have at the moment work very well with a vertically-split, 1/3rd-2/3rd screen (or 1/4-3/4). Unfortunately, the zsh prompt I currently have, when I'm ...
2
votes
0answers
54 views

Does a fuzzy matching mode exist for the zsh shell?

I've recently fallen in love with efficient text completion systems. One of my favourite kinds of completion is so-called fuzzy completion. This is a mode where the program will complete the user's ...
3
votes
0answers
92 views

Git completion with aliases

I have a convenient dotfiles repo on Github for you all to look at, here. FYI, git is installed via Homebrew, as with most of the executables on my system. My git-completion in zsh works fine when I ...
1
vote
0answers
55 views

zsh completion after installing/removing packages

How does zsh figure out currently installed packages on Debian, and how can I update that information? After running apt-get install, zsh won't autocomplete that package as a possible parameter for ...
2
votes
1answer
72 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
2answers
43 views

How do you make zsh meta-delete behave like bash? (To make it delete a word instead of the entire path.)

Bash's meta-delete will remove one path component instead of the entire path. How do you get zsh to behave like that? I found this, which seems to work. Is this the right thing to do? One of the ...
0
votes
1answer
26 views

Recursively count files matching pattern in directory in zsh

How do I recursively count all files of a certain type in zsh? There are quite a few methods to do this (helpful SuperUser questions such as this one give pointers), but few zsh-specific methods. ...
1
vote
1answer
80 views

Why does grep return no results (list all files in directory)

I'm trying to count all files in a directory that match a pattern, recursively, using ls: ls -R | grep *.{cpp,h} | wc However, I get: zsh: no matches found: *.cpp ls -R does return results, ...
0
votes
4answers
113 views

How can I clean up my bashrc/zshrc file?

Over time, I've added bunches of stuff to my PATH and it's lookin' pretty awful. How can I clean this up or what's the proper way to "reformat" all of this? export PATH="$PATH:~/scripts" export ...
0
votes
0answers
49 views

Menu tab completion for recent history in zsh

I am interested in a potential zle widget for zsh. Is there a way to build a widget that mimics the kill-completion selectable menu? Essentially I want to be able to press , tab in vi-command-mode, or ...
1
vote
1answer
48 views

how can I invoke the last 3 commands in shell history

Lets say my last 3 commands were: % rm foo.out % myprog > foo.out % cat foo.out I will like to invoke the last 3 with one stroke of the enter key, i.e. do some shell history commands which ...
1
vote
2answers
45 views

Stopping ZSH from correcting a single command

Every single time I try to use npm in zsh it asks me if I meant nm. It's gotten very annoying now. I like the auto correct feature, though. How can I turn it off for the npm command?
0
votes
2answers
88 views

How can I make Bash (or Zsh) run a particular command before each entered command?

I'd like to configure Bash to run a particular command before running each command line I enter at the prompt. Specifically, I'd like to tell Vim (which is running in another terminal) to write all ...
2
votes
1answer
54 views

how do I correctly negate zsh globbing expressions?

I want to list all files but those ending with owp: Hence I tried: ls -l *.(^owp) zsh: unknown sort specifier ls -l *(^owp) zsh: unknown sort specifier ls -l *[^o][^w][^p] # does not work ...
0
votes
1answer
58 views

How do I get searching through my command history working with tmux and zshell?

I use zshell and am trying out tmux. In shell if I hit control-R, it fires off bck-i-search and I can begin typing to match commands previously entered. When in tmux, control-R appears to do nothing. ...
0
votes
1answer
61 views

How do I get zsh's autocomplete to complete wildcards like bash does?

In zsh and in bash, if I type ls c<TAB> it displays every filename starting with c. If instead I type ls c*<TAB>, bash behaves the same way, but zsh replaces the c* with the list of every ...
0
votes
1answer
94 views

Colors in zshell prompt cause odd behavior

I'm running OSX Lion 10.7.3, zsh version 4.3.11. I've found that if I have color escape codes in my prompt, it royally screws things up. For instance, if I scroll forward through the command history ...
0
votes
2answers
59 views

oh-my-zsh turned on autopushd? How can I turn it off?

It appears that I have autopushd turned on (I know I didn't turn it on) and it is rather annoying because I prefer to pick and choose when to use the directory stack. How can I turn off autopushd? I ...
1
vote
0answers
33 views

Is there anyway to color `git push` output?

I've tried using: stderred, https://github.com/sickill/stderred colors in git, http://scie.nti.st/2007/5/2/colors-in-git global config color.ui=true. Though the output from git push on error is ...
0
votes
1answer
117 views

rename file with zmv

I just discovered zmv this morning. To test it i have created a few files. test1.txt test2.txt test3.txt I'm trying to rename them with zmv I'd like to get this output: test-1.txt test-2.txt ...
1
vote
3answers
73 views

Piping file to a command that doesn't implement piping

$ cat foo foo bar Now if I do: $ some_program foo It's working. But if I try: $ cat foo | some_program It's not working. I'm looking for a clean way to pipe input to some_program without ...
2
votes
1answer
75 views

zsh alias “…”

I have an ZSH alias: alias -g ...='../..' alias -g ....='../../..' When I try to cd ..., things work perfectly. I can't, however, use it in a cp command: cp .../file . fails with cp: .../file: No ...
0
votes
1answer
64 views

Colored man pages but git --help is not in ZSH

I have colored man pages according to: alias man="TERMINFO=~/.terminfo/ LESS=C TERM=mostlike PAGER=less man" so man less looks like but git blame --help is uncolored
1
vote
1answer
54 views

ZSH expansion for a timestamp?

My coworker has this nifty key combination he types in when touching a new file that expands out the current timestamp (YYYYMMDDHHMMSS) to where the cursor is, so he can quickly create timestamped ...
0
votes
1answer
113 views

Where can I find my (current shell process') PID?

I'm on OS X using ZSH (have lots of homebrew stuff, too). I'd like to know the PID of my current terminal. (I'm learning more about process management on *nix systems, pstree and the like, and so ...
1
vote
1answer
153 views

ZSH with mintty on latest cygwin?

Does anyone know how to set mintty to use zsh on the newest cygwin install?
2
votes
2answers
56 views

Key bindings in zshrc do not take any effect

I have just switched to zsh, and I would like to bind Home, End and Delete keys such that they would act similar to how they do in bash. I have found some commands that work if I enter them directly ...
2
votes
1answer
60 views

How can zsh be configured to autocomplete directory name with camelcase matching?

Eclipse and Resharper have a nice way of navigating files. If I have the following folders (or files) in my current directory MyReallyLongName MyReallyLongAndFunName MyReallyLongAndNotReallyFunName ...
2
votes
1answer
86 views

How to search *upwards* for file? (reverse find)

I'd like to search "upwards" for a file in shell script, e.g. check $PWD, then $PWD/.., then $PWD/../.., etc. until hitting the root. Before I go and roll my own, is there some builtin bash/zsh/find ...
1
vote
1answer
96 views

zsh auto-complete event designator

(See my previous question for additional context). I'm migrating to zsh from bash, and using oh-my-zsh. When my zsh history looks something like the following: git status git add -A git commit I ...
1
vote
1answer
64 views

Repeat last command matching “two words” zsh

I want to repeat the last command that matches foo bar. Using !! doesn't work (it's not the last command I used), and neither does !foo, because my history looks something like foo bar dee zep foo ...

1 2 3 4 5