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

learn more… | top users | synonyms

0
votes
0answers
6 views

Add strings to zsh tab completion for all commands and arguments

I want to add the keywords foo and bar to be added to the auto completion results for any command or argument. eg: cd <TAB> should give foo and bar in the suggestions in addition to the ...
0
votes
1answer
26 views

Bitvise SSH Server putting extra spaces in session

I am using Bitvise SSH Server on my Windows machine for remote access. The login shell is ZSH, and I am using Oh My Zsh with it. However, I have also tried BASH and got the same problem. Therefore I ...
1
vote
2answers
629 views

Is there a way to reverse-search zsh history with more than one search term?

I'd like to be able to reverse-search (CTRL+R) on zsh, but have the commands searched using more than one search term. For example, I'd like to search through commands that included both "scp" and ...
2
votes
1answer
49 views

Why does `zsh` insert a `~` when I press the delete key?

I have set my zsh to use vim style for editing command lines. However, when I use the Delete key, it inserts a ~ character. Have I misconfigured my zsh? How do I turn this off? Do I need to go ...
0
votes
1answer
68 views

Prezto Paradox theme not displaying properly

I have a question somewhat similar to: https://unix.stackexchange.com/questions/236885/installing-powerline-fonts-for-zsh-prezto-theme I'm on OSX 10.10.5 using Iterm2, Zsh, and Prezto with more or ...
4
votes
3answers
45 views

Periodically source shell profile

I'm a zsh user, but this should apply to any shell in theory. When I edit my .zshrc to add a new alias, I have to source ~/.zshrc in all of my open terminal tabs/windows to be able to use the new ...
0
votes
1answer
13 views

How do I get the aws cli completion to work with zsh on OS X?

Similar to this question: How do I get the aws cli completion to work with zsh on ubuntu? This command from the aws-cli documentation did not properly setup auto completion. source ...
2
votes
4answers
793 views

Disable zsh autocorrect entirely

How do you disable zsh autocorrect entirely? I am aware of the 'nocorrect' option which only applies to certain commands. But I want it off entirely so that when I type 'lear' instead of 'clear', it ...
1
vote
0answers
64 views

What is a close option in zsh to readline's `completion-prefix-display-length`

When completing, if the typed part is long, this option replaces the same part in the completion menu items with ellipsis. Especially useful if the typed part is long and there are many candidates.
1
vote
2answers
29 views

Import previous commands to edited command

I'm playing with zsh to change image modification time according to the 'Date/Time Original' exif attribute. For this I one command I do: PDATE=$(exiftool -p '$DateTimeOriginal' $PIC | sed 's/[: ...
1
vote
2answers
31 views

Zsh snippets implementation

Is there any way to implement expandable snippets in zsh? I'd like to be able to write ssh ssh_alias -t :tmux press tab and this would be expanded to the `ssh ssh_alias -t "tmux a||tmux" I want this ...
0
votes
0answers
4 views

How to show result of git reflog in the same window as the other commands?

When I type git reflog, the result is shown in another window like with man command (I don't really know how to call it). To quit the window you must use q key. How to show the result in the same ...
3
votes
2answers
43 views

How does dpkg know that a config file has been deleted?

I recently had an odd problem where I would install zsh (apt-get install zsh) but it would not install the config files - specifically /etc/zsh/zshenv and friends. Following some considerable time ...
0
votes
0answers
18 views

Bash in Conemu is overlapping lines

When I start nano/vi or a program that normally clears the screen then I can still see the command line. That means that the terminal is not cleared. If I scroll with the arrow keys the lines ...
1
vote
1answer
74 views

How to get bash-style autocompletion in zsh, (for git command)

I switched to zsh and find it better than bash, but I have a problem with oh-my-zsh's (hereafter "OMZ") autocomplete feature. When I type git chec, OMZ completes that to git check; in bash it gets ...
1
vote
2answers
206 views

Zsh autocomplete function with sed

I'm struggling to write an ZSH autocomplete function. My goal is to autocomplete ta's and tk's first argument with the projects listed in tmux list-sessions and tmuxinator list. Here's what I have so ...
0
votes
0answers
13 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
22 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
10 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
49 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
27 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 ...
14
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
136 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 ...
5
votes
2answers
2k views

How can I get zsh to display international characters properly?

I just started using zsh, and love it. However, I've stumbled upon an annoyance when it comes to international characters: ➜ ~ touch åäö.txt ➜ ~ ls ...
0
votes
2answers
44 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 ...
0
votes
2answers
561 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
39 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 ...
0
votes
0answers
41 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 ...
42
votes
8answers
18k 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
262 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
339 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
28 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
494 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 ...
1
vote
3answers
327 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
348 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 ...
3
votes
2answers
299 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 ...
22
votes
1answer
4k 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
14 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
200 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
15 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
40 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
10 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
42 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
27 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
21 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
25 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
23 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
45 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, ...