0
votes
2answers
26 views

Zsh: how to auto complete after a command?

everyone. It's a little difficult to explain what I want to do. I want to create a script 'example', which can input long commands for you after you run it with short parameters. For example, $ ...
0
votes
1answer
40 views

zsh (or maybe oh-my-zsh) history gets confused with multi-line commands

if I use the up arrow in a zsh session, as you'd expect I get previous commands, from newest to oldest. Now (whether it's zsh or oh-my-zsh doing this I don't know), but if I type the start of a line ...
0
votes
1answer
34 views

ZSH: Where to place environment variable so that launched application can pick it up?

I need an environment variable KEY="value" made available to a GUI application before starting it. The launcher file (the one that places the icon on the desktop and sidebar in Ubuntu) has a value of ...
0
votes
0answers
24 views

Zsh prompt produces an error

I have the default prompt for oh-my-zsh, which is great when I have a git repo, but if there is no git repo its actually failing instead of putting nothing. I trapped an ascii image to err just for ...
1
vote
2answers
23 views

How to delete one directory level in a command argument (up to a slash) on ZSH command line?

I just switched from bash to zsh. One thing that is different and a bit annoying from me that Alt-Backspace removes the whole argument instead of just one word. I'm used to using it to remove one ...
0
votes
1answer
16 views

automatically launch/open a file when it changes

OS: OS X Lion Shell: zsh I'd like to automatically launch/open a file when it changes. Background: i'm working on a windows vm, generating pdfs. Syncing via dropbox and when a file changes on ...
1
vote
4answers
55 views

Remove all folders that does not contain a specific name in UNIX

I'm trying to figure out my old skill in *nix. What I'm trying to achieve is to remove every folders that does not contain a specific word. This is the listing ➜ myfolder: pwd /user/myfolder ➜ ...
1
vote
1answer
34 views

Pre-compiled command line input in zsh

I recently set up a ubuntu 12.04 64 bit machine. I use tmux with many open windows, all of them use zsh as shell, some of them through a chroot environment that uses the same home folder of the normal ...
0
votes
0answers
33 views

Why the second time creating a ramdisk make /dev/rdisk2 instead of /dev/rdisk1?

I run the first time ever: diskutil erasevolume HFS+ ramdisk `hdiutil attach -nomount ram://8475854` It create the ramddisk at /dev/rdisk1. The computer power off, power on then I repeat the same ...
0
votes
2answers
207 views

Prevent zsh from trying to expand everything

Recently switched from bash, I noticed that zsh will try to expand every command or argument that looks like it has wildcards in it. So the following lines won't work any more: git diff master{,^^} ...
1
vote
1answer
151 views

Run a local command after closing an SSH connection?

I've set up my zsh to update the XTerm title whenever I change directories. It's neat! Unfortunately I have one common problem, which is this: % cd foo; # title changes to "host1:~/foo" % ssh ...
1
vote
1answer
36 views

zsh — ^W behavior with oh-my-zsh

I've recently started using ZHS with oh-my-zsh script pack. It does excellent job except of weird ^W shortcut behavior. For example if I have following command line and symbol ▮ denotes cursor ...
1
vote
1answer
308 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 ...
0
votes
1answer
133 views

What command, if any, can be a good alternative to sublime text's find in folder?

Is there a way to find a string or phrase recursively in all files in a folder from the command line, such that the output would be similar to Sublime Text 2's find behavior? Like, with the path of ...
3
votes
3answers
51 views

Can I cycle through the history of shell commands that have only been used from current directory?

So when using arrow up/down to cycle through prior commands, is there any way I can limit those to the commands used from the current directory? This would make my life 10 times easier...
1
vote
2answers
169 views

How to merge ls commands colors with the output of find or du?

I have a simple alias to list the size of files&folders in cwd. ( including dotfiles in this case , ignoring zero sizes ) du -sh .[!.]* * | sort -hr | grep -v '^0' which can be achieved ...
3
votes
2answers
345 views

How to execute a function in bash or zsh on every letter being typed into prompt?

I know about preexec() hooks for zsh and the way this can be achieved in bash. ( link ) But can i get the current input while still typing? The idea behind this question is the following: in order ...
3
votes
2answers
162 views

Always run a command after another command

With zsh (and oh-my-zsh), is it possible to always run a command after a certain other command? I want to always run an ls after cding to a directory, rather than running cd example; ls every time. I ...
1
vote
1answer
131 views

ZSH Quote escaping and expansion

I am trying to run tmux, passing several commands at once, and I'm unable to properly quote the string. The command succeeds when manually entered on the command line: ~% /usr/local/bin/tmux ...
2
votes
1answer
181 views

How can I open an application using the command line and then close the terminal without closing the opened application?

If I open an application from the command line, say Firefox, the application runs as long as the terminal stays open. Closing the terminal's tab will close the application. Is there a way to open an ...
3
votes
3answers
69 views

Only complete command names if no file name completions exist

Reasoning: I have autocd enabled, yet I never use it because it makes tab-completion a huge pain, as every single command name on my system will be completed along with the filename completions. ...
3
votes
1answer
137 views

Edit Current Command in Zsh Vi Mode

So I know that you can set vi mode in bash with set -o vi I also know that you can set vi mode in zsh with bindkey -v The vi mode in bash has a great feature that allows you to edit the command ...
0
votes
1answer
111 views

Invoke zsh, then *source* another file (while entering interactive mode)

This question is of course related, but different to the one about executing a command. That questions’ solutions involve either starting a subshell – which isn’t possible due to the requirement of ...
0
votes
1answer
157 views

Putting the “canonical” working directory in a zsh prompt on OS X (iTerm 2, if that matters)

I use zsh and oh-my-zsh for my shell environment on OS X, and I'm having a hard time tracking down whether or not the thing that is happening is a result of an oh-my-zsh function or the default ...
0
votes
0answers
21 views

ZSH not finding commands [duplicate]

I've noticed several times that zsh can't find commands when running pipes, e.g.: ➜ ~ ps aux | grep terminal zsh: command not found:  grep ➜ ~ curl -L ...
2
votes
1answer
188 views

Adding a specific binary (zsh) to the $PATH?

I have installed a more recent version of zsh using homebrew, located at /usr/local/bin/zsh. which zsh returns /bin/zsh. How can I make /usr/local/bin/zsh the default, without adding the entire ...
1
vote
0answers
203 views

zsh - prompt redraw after executing command

I just started using zsh and I'm configuring a few things. I've chosen the vi bindings as I'm more familiar with those. As many people before me, I soon found it would be useful to have some visual ...
6
votes
2answers
2k views

How can I make zsh's vi mode behave more like bash's vi mode?

I am really liking the general speed of zsh, but two things are annoying the heck out of me. I have to hit wait a moment between hitting escape and hitting slash to get to the history search (if it ...
2
votes
1answer
203 views

Prevent zsh from setting the current prompt to the name of the variable that points to this path

This is related to Zsh: Open a new tab in the same directory. I have installed oh-my-zsh recently and it certainly kicks. I have some custom variables, like $WORKSPACE which I use to get around ...
3
votes
1answer
639 views

zsh alias with default argument, but also overridable

I currently have a zsh alias setup like so. alias e="subl" This lets me e somedir to open up a directory in SublimeText. or e . to open up the current directory. However, I would like to be able ...
0
votes
1answer
761 views

Oh My ZSH plugins do not load on startup

Using iTerm2 or Terminal.app I have to run su $USER in order for my plugins to load or display in my prompt (e.g. the RVM plugin). Any reason why this would be?
1
vote
3answers
157 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 ...
7
votes
1answer
3k views

How can I put a newline in my zsh prompt without causing terminal redraw issues?

I'm trying to fix a minor (but annoying) issue with my zsh prompt. The problem I'm seeing is that when I'm using a terminal in a GUI OS environment (for example, Terminal.app or iTerm 2 on OS X ...
1
vote
1answer
193 views

Record all commands

I am learning ruby and following tutorials in a book. I want to record all the commands i enter in shell( I am using zsh) . How can I do that? I should be able to stop and start recording.
6
votes
1answer
1k views

How to prevent a command in the zshell from being saved into history?

In Bash I know putting a space before a command prevents it from being kept in the history, what is the equivalent for the zshell?
10
votes
1answer
3k views

How to switch comfortably to vi command mode on the zsh command line?

In vi, I have mapped 'jj' to escape to be able to switch to command mode without using the annoying escape key. Now I want to have the same for command line editing for which I use vi-mode. I already ...
5
votes
2answers
365 views

bash wildcard completion

Is it possible to make bash expand wildcards on tab completion in the same style as zsh? So imagine the following: mkdir new touch new/1.txt new/2.txt new/3.log Now, ls new/*.txt<TAB> ...
5
votes
2answers
563 views

Access Finder's “Open With” menu from the commandline (for tab completion)

On Mac OS X, I know one can open a file from the commandline with its default application with open, and with other applications with open -a <application name>. Thus, open movie.avi open -a ...
19
votes
4answers
7k views

Change iTerm2 window and tab titles in zsh

I want to label the window tabs of terminal sessions. I'm using the zshell in iterm2 on OSX. Is it possible to change the label of a window tab dynamically in the terminal?
1
vote
1answer
170 views

Efficiently editing commands with zsh

Let's say I use CTRL-R and then type tail to find the last time I ran tail. What comes up is tail -F /path/to/log/file-2011-03-07.log The command I want to run is the above command, but with ...
3
votes
1answer
739 views

How to use regex quantifiers to rename multiple files with zmv?

I have the following files in a single directory: 1-1 - different text for each file here.txt 1-2 - different text for each file here.txt . . 1-9 - different text for each file here.txt 1-10 - ...
1
vote
2answers
1k views

zsh conditional statement help

Feeling kinda dumb right now: Why is my contional always true? I've tried # this should let me know what's not a directory or # symbolic link. whoa=`find ${MUSICDIR} ! -type l ! -type d | wc -l` ...
0
votes
3answers
397 views

Display Unicode Tetris boards in Terminal — or how to dynamically decrease line height

I am using black squares \xe2\x97\xbc◼ and white squares \xe2\x97\xbb◻ to display tetris boards in my shell. Unfortunately there is quite a visible line spacing between rows and that just doesn't look ...
2
votes
1answer
307 views

How to pipe output of certain commands to a pager with zsh?

I am frequently working with subversion in console using its client svn. One of common tasks is viewing svn log; however its output is usually pretty massive despite of --limit option. I would like to ...
4
votes
2answers
1k 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 ...
1
vote
1answer
117 views

How to solve this problem with a 'tuned' prompt in ZSH?

I have an adjusted prompt in my ZSH-configuration. Main feature is, that this prompt is colored red, so that I can easily it distinguish from the outputs of programs. My prompt is defined as follows: ...
2
votes
2answers
104 views

How can I fix typing a command name twice in zsh?

So I have this (bad) habit of typing git , pausing for a sec to glance at the output of the git status command I just typed, then typing git add ... afterwards, resulting in the rather unsuccessful ...
22
votes
6answers
6k views

What zsh features do you use? [closed]

I do a lot of work in the terminal so I have learned a lot about my shell of choice, zsh. What features of zsh do you use to make yourself that much more productive at work? One of my favorites is ...