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

learn more… | top users | synonyms

0
votes
0answers
27 views

How do I send, through hotkey, a SIGINT (CTRL+c) to a process running inside tmux?

When I open tmux and start a long running process without output, how do I kill it with a hotkey Ctrl+c? On a normal zsh shell when I press Ctrl+c the process receives a INT signal and (hopefully) ...
1
vote
1answer
28 views

can't find zsh history on OSX 10.8.5

When I log into the Terminal app on OSX my default shell is /bin/bash. Entering echo $HISTFILE points me to /Users/monkeybrain/.bash_history and head $(echo $HISTFILE) shows me that the file contains ...
1
vote
1answer
15 views

zsh completion doesn't work when prepending to word

I have two versions of a certain application, the one in my PATH and one at ~/install/app. So normally I do app file But sometimes I want to do, right after that: ~/install/app file With bash I ...
0
votes
1answer
61 views

git commit hash in zsh prompt

I'd like to see the current commit hash (just the first 8 or so characters) in my zsh prompt. I have this so far: https://github.com/calebmeyer/cpm-zsh-theme/blob/master/cpm.zsh-theme#L3 ...
9
votes
9answers
1k views

Per-directory bash/zsh history log files

I find I do a lot of work on a project in a set directory. Sometimes — a few months down the track — I need to redo something on that project but I can't remember what I did. I use ...
1
vote
2answers
33 views

Remove all extensions in zsh

Say I have a directory with many files with the .bak extension, and want to remove this from each. What's the simplest way to do that? I mean a command that would do what one might exspect from mv *....
16
votes
2answers
4k views

ZSH - output whole history?

I recently switched from bash to zsh. In bash, one way (besides recursive search) that I used to find previously-run commands was history | grep whatever, where whatever is the bit of command I ...
3
votes
1answer
290 views

iTerm 2 ZSH colors/themes not showed correctly

I have a clean installed mac, running OS X 10.11.4. I have installed iTerm 2, and set it up to use oh-my-zsh. I'm trying to set up a theme for my iTerm. I am trying to use the avit theme. It's ...
0
votes
2answers
55 views

What exaclty is <() in bash (and =() in zsh)?

I'm pretty confortable with bash, but recently I ended up in a substitution I didn't know. What exactly is <(<command>) in bash? How does it compare to the =(<command>) in zsh? I ...
1
vote
2answers
649 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:
1
vote
1answer
86 views

Unable to login as root or as user because zsh is missing

I installed zsh on my raspberry pi and for various reasons including the fact that the shell completely slowed down, I decided to remove it. I uninstall the package, changed the shell back to /bin/...
0
votes
0answers
56 views

.hushlogin but for all folders in iTerm2 / oh-my-zsh

I updated to iTerm v3 beta, and now when I open a new tab with the same location of the previous tab, it shows the Last login MOTD if it's any folder other than ~/. I've read quite a bit about doing ...
46
votes
8answers
19k views

zsh starts incredibly slowly

ZSH takes about a second and a half from creating a new terminal window to being ready. I'm pretty sure that the culprit is compinit. I haven't been able to find good documentation on compinit, but ...
1
vote
2answers
265 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
vote
2answers
341 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 ...
3
votes
4answers
1k views

Zsh, directory tab-completion with prefix

I have a directory where I put all my projects in, let's say it's ~/projects as an example. I've made a command called s which takes one argument, and moves me into that directory. E.g.: s foo moves ...
1
vote
0answers
37 views

Error when trying to exit terminal emulator

Background I run zsh by default, and spend most of my day logged into a terminal. My workstation and all of the servers I interact with on a daily basis are Linux-based, and I either use zsh or bash ...
3
votes
2answers
514 views

Increment file number using zmv

I have a set of files that are named in the vein of "some_file-nameN", where N is a number starting at 1, incrementing, and ending somewhere between 10 and 30. I now need to insert a file at the start....
1
vote
3answers
343 views

ZSH: menu select autocompletion for history search

ZSH has a powerful menu select autocompletion e.g. for choosing a directory, choosing a process with kill (kill[tab][tab]). You can use arrows to navigate around the choices. Is it possible to have ...
5
votes
3answers
370 views

Put a command in history without executing it

In bash, if I have a command on the line, and I press Alt-# (with the cursor anywhere on the line), it adds a # to the front of the line, commenting it out, 'executes' it (which does nothing since it'...
3
votes
2answers
331 views

Typing 'git log --oneline' in oh-my-zsh pipes to 'less'

I just switched to Oh My Zsh and I'm using the Avit theme. When I type git log --oneline my output seems to be piped to less. It does this for whatever theme I use. When I used bash shell, it never ...
24
votes
1answer
6k views

How to fix and recover a “corrupt history file” in zsh?

After a reboot, I started seeing a message when loading the shell: zsh: corrupt history file /home/myusername/.zsh_history How can I recover from this situation and potentially recover some of the ...
1
vote
1answer
24 views

zsh autocomplete results from function

I've been searching and searching and unable to find a clear way to do this: Slightly contrived example to hide details: Say I want to autocomplete tmux session names with a command that will open ...
0
votes
1answer
266 views

How to configure custom keyboard shortcuts in ElementaryOS Freya?

How do you actually set what the keys do??? http://blog.elementary.io/post/119612714681/custom-keyboard-shortcuts-are-here When I go to this screen I: press the + button enter the name of the ...
0
votes
1answer
18 views

Tab glitch with tmux in archlinux

Bug difficult to explain, as it can have extremely random effects. But the idea is : when I open a new tab in my terminal using tmux (in tig, vim or cmus for exemple), the text always gets extremely ...
1
vote
0answers
53 views

Running GNU Screen on Raspbian with vertival split spilling content

I am running Screen on a Raspberry Pi. My shell on the Pi is ZSH with OH-MY-ZSH. I have connected to the Pi via SSH from a Mac. When I run certain commands like HTOP or Vim the output spills over to ...
0
votes
0answers
12 views

zsh: enable normal path expansion for git commands

In zsh, I can expand a filename by just typing the first letter of each directory in its path and hitting <TAB>: % ls /e/z/zshe<TAB> % ls /etc/zsh/zshenv This works as long as the ...
0
votes
1answer
50 views

Dumping current .zshrc from terminal

I've wanted to make quick edit in a .zshrc, but vim said that it can't be written or something. So I quit, with :q!. Then I wanted to reopen this file... and it was empty. I still have terminal open ...
0
votes
0answers
34 views

Weird output when setting zsh prompt

I am setting my zsh prompt to be % by setting the BULLETTRAIN_PROMPT_CHAR variable in my .zshrc file but when it starts up the prompt is %f. I have tried \% and it still does the same thing. Note I am ...
1
vote
0answers
25 views

zsh read input in zle widget

I am trying to implement a custom version of zsh history search when pressing ctrl-r (although my function will map to different shortcut). So far I have tried to use read , vared and read-command to ...
0
votes
0answers
36 views

Selecting a group in a pattern on ZSH Glob

How can I select a group in a ZSH pattern to be used later in a substitution or a reference? Example: print the files matching a given pattern and followed by a substring of that name selected from ...
0
votes
1answer
25 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
69 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, when ...
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 ...
41
votes
7answers
44k 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
67 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 PATH=/Users/...
0
votes
1answer
33 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-@> <c-space&...
1
vote
2answers
105 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
197 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
37 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. ...
31
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
105 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
136 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. ...
9
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
35 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
63 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
104 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 ...