Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [zsh]

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

0
votes
0answers
7 views

Set window title in iTerm with zsh

I am using iTerm2 in my mac with zsh. I have set DISABLE_AUTO_TITLE="true" within .zshrc. Now I can use title to set window and tab titles. But it the title which appears in the title has the running ...
0
votes
2answers
44 views

Don't show output of “cd -<#>”

In oh-my-zsh, doing a cd - outputs the target directory, which is redundant since my shell prompt shows the relative working directory. I understand I can do cd - > /dev/null, but I'd have to type ...
1
vote
1answer
26 views

Is it possible to use zsh in windows machines?

Is it possible to use zsh shell in windows along with console 2. If possible how can I install and configure it.
0
votes
0answers
39 views

All Homebrew apps returning “zsh: command not found”

All the apps get a weird behaviour when installed from Homebrew. I installed htop from brew brew install htop From terminal, I can see it when typing tab for autosuggestion: But when I press ...
1
vote
0answers
14 views

zsh in vi mode but using arrow keys to search history

When vi mode is enabled for zsh (bindkey -v) is there anyway to search the history as per the regular mode, i.e. by typing a few letters and pressing the up/down arrow keys? I find this much quicker ...
2
votes
1answer
18 views

Is there a way to programatically access and save a list of completion candidates in Zsh?

In Zsh by default the tab key is bound to expand-or-complete. I would like to programatically access the list of completion candidates that would have been produced by pressed tab, so that I can write ...
1
vote
0answers
33 views

Why does my PS1 environment variable keep getting overwritten?

I'm trying to customize the prompt by adding a line such as export PS1='%d' to my .zshrc file. However the environment variable keeps getting overwritten. In fact I can do the following at the ...
0
votes
2answers
170 views

How to configure zsh with oh-my-zsh to keep git history visible after pressing “q”?

I use zsh with oh-my-zsh on a daily basis but there is a small thing that bothers me. If I use git log or any other similar command then the output occupies full terminal window. After pressing q the ...
1
vote
0answers
30 views

Detach a terminal from a process in D (uninterruptible sleep) state

I have a shell command in stuck in D state (imagine doing ls on a NFS share when the network is down). How do I detach from such a command? I can't kill the process in any way (well, it's called "...
2
votes
0answers
22 views

How can I avoid conflicts in zsh keybindings?

I'd like to bind a function to CtrlgCtrlb in zsh. gb-widget() { echo "geebee" } zle -N gb-widget bindkey '^G^B' gb-widget This doesn't work with CtrlgCtrlb, but it works fine with other ...
0
votes
2answers
32 views

Preview current directory in shell

What often happens when I work in a shell - zsh - is that I have cded somewhere and I want to have a quick look at the directory. Using ls may produce a lot of output and leaves it in the terminal. ...
0
votes
0answers
31 views

Cannot get arguments from the previous command in ZSH

There are well-known shortcuts to get arguments of the previous command in bash, like Alt+. or $!, etc. None of this is working in my zsh, I am using some zprezto modules. I was not able to find ...
0
votes
1answer
29 views

What is `self-insert` is for?

What is self-insert is for in zsh? I see it every where in the prezto configs but cannot grasp what it is suppose to do, ZLE documentation is also not specifying what it is, however mentioning it in ...
1
vote
2answers
33 views

Use vim in pipeline to dump current line on exit to stdout?

Is it possible for me to do something like this: $ ls | vim | xargs ... and have vim pass to stdout any lines that were visually selected on exit? If it'd be easier to just dump the "current line" ...
0
votes
1answer
185 views

How to check what is the default shell

Is there a config file that stores the default shell (bash, zsh, etc) for the current user ?
0
votes
0answers
79 views

Zsh does not enter vim mode

I have the following setup on Ubuntu 14.04. Here is my .profile which switches to zsh because I don't have permission to run chsh: export·PATH=$PATH:$HOME/bin export·SHELL=$HOME/bin/zsh exec·$HOME/...
0
votes
1answer
91 views

Zsh terminal not working correctly in fresh Manjaro install

recently I've been experimenting around with different Linux distros, I settled with Manjaro Linux. First I installed it on my laptop, everything went fine. When i was prompted to choose a terminal ...
0
votes
0answers
47 views

ZSH: bindkey and escape sequences from array

On my old machine (Ubuntu 17.04), I added the following entries to my .zshrc: bindkey "${key[Up]}" up-line-or-local-history bindkey "${key[Down]}" down-line-or-local-history On my new machine (ZSH 5....
1
vote
1answer
136 views

Zsh or Bash: Pass all command output through pager like app automatically?

Is there a way in bash or zsh to automatically pipe all output from any commands I run through another program? For example, if I ran this command $ cat /tmp/it I'd like it to run like I had ...
3
votes
1answer
33 views

Filename generation from variable in zsh without spawning subshell

In zsh I have a glob pattern in a variable, and I want to define another variable that performs filename generation on that pattern. Is there a way to do this without spawning a subshell? The ...
0
votes
1answer
84 views

What is this extra column when I run 'ps' command?

I am running Babun with oh-my-zsh on a Windows machine. When I run the ps command without any arguments I get the following output: PID PPID PGID WINPID TTY UID STIME ...
0
votes
1answer
321 views

'ls' output doesn't show color anymore in macOS High Sierra

I use zsh and oh-my-zsh: As shown in the screenshot ls is not showing color output anymore. I set color theme from iTerm2 and set zsh theme (wezm+ theme) from oh-my-zsh. I try to set manually ...
0
votes
1answer
44 views

Korean Filenames are shown like ''$'\355\225\234\352\270\200''.'txt' in iTerm2 on OSX HighSierra

From 2 days ago, when I enter ls in iTerm2(also default terminal app), directories I created are shown like '0. PCR', and Korean filenames are shown as ''$'\355\225\234\352\270\200''.txt'. In ...
3
votes
1answer
58 views

Can zsh RPROMPT disappear when I start typing or after I run a command?

I make use of RPROMPT to show me some "extra" info that I don't want to spend PROMPT space on. However, it gets in the way when I want to cut-and-paste from my terminal window into docs, I have to ...
1
vote
1answer
73 views

Running functions that were declared outside my shell script

Currently my ZSH has some sourced functions, for instance: % declare -f ... a lot of shell functions appears here. I'm currently writing a shell script that will call a specific function from ...
7
votes
1answer
607 views

bash / zsh alias: Can I grab the arguments and use within subshell?

I would like an alias that gives a directory listing in dictionary order with "." files first. It seems that one few ways to accomplish this devoid of writing my own script (which isn't a real problem)...
1
vote
0answers
59 views

Same zsh config acting differently on different machines

I have the following config for zsh that I use on both my laptop and remote machine. I have all my config files put in a git repository that is cloned into ~/.zsh and symlinked into ~. autoload -Uz ...
0
votes
0answers
125 views

What/Where/How is the proper place to configure the PATH environment variable in zsh?

The official zsh manual seems to recommend that you configure the PATH environment variable in zshenv: http://zsh.sourceforge.net/Intro/intro_3.html `.zshenv' is sourced on all invocations of the ...
0
votes
1answer
113 views

Why does `source ~/.aliases` not work in .zshrc?

user@localhost ~ % zsh --version zsh 5.5.1 (x86_64-redhat-linux-gnu) me@localhost ~ % lsb_release -a LSB Version: :core-4.1-amd64:core-4.1-noarch Distributor ID: Fedora Description: Fedora ...
3
votes
1answer
166 views

Why does a value '-' (hyphen) in “tag-order” style prevent matching of the “executables” tag even if that tag is explicitly specified?

With the code below, everything works as expected: When I write c and hit the TAB key, I get the appropriate completions in correct order. When I write ./ and hit the TAB key, I get the ...
2
votes
0answers
72 views

How to customize the look of currently selected(highlighted) completion in zsh?

Main question I would like to add powerline characters at the start and at the end of the selected completion, like this: Started the completion menu by inserting a c and pressing the TAB key. ...
4
votes
2answers
29 views

Why does a value '-' (hyphen) in “tag-order” style prevent matching of the “executables” tag even if that tag is explicitly specified?

With the code below, everything works as expected: When I write c and hit the TAB key, I get the appropriate completions in correct order. When I write ./ and hit the TAB key, I get the ...
1
vote
1answer
96 views

zsh+ohmyzsh+powerlevel9k: completions stop working when issuing 'sudo -s'

I am having strange issue with zsh and ohmyzsh(with powerlevel9k theme) on MacOS High Sierra. After installing ohmyzsh when issuing sudo -s getting annoying and strange output of some script. And all ...
4
votes
1answer
754 views

On Ubuntu 18.04, snap apps don't appear in the Dash

I just installed Ubuntu 18.04 and a few snap apps (Slack, Spotify). Snap apps don't show up in the regular "app list" when I search for an app, and I don't understand why. I'm running zsh, so I found ...
0
votes
1answer
403 views

MacOS cannot execute binary file after uninstall zsh

After I open the terminal this text will appear: Last login: Mon Mar 26 17:51:02 on ttys001 -bash: /usr/local/bin/dirname: cannot execute binary file -bash: /usr/local/bin/dirname: cannot execute ...
0
votes
1answer
358 views

ZSH / BASH : Delete specific lines from history

My history is 'polluted' with some specific lines that have typo's and such. For example: I often have to ssh to a certain server like so: ssh foo-bar@domain.tld > Connects succesfully But I also ...
1
vote
0answers
239 views

Is it possible to configure Anaconda Prompt to use different Shells?

Is it possible to configure Anaconda Prompt to use a different shell environment from the default installation on Windows-10? I can't find any documenation specifying the Shell Anaconda Prompt uses, ...
0
votes
1answer
268 views

Wrong Python version returned, with correct $PATH set in ZSH

something very wrong is happening with my environment set up. As I am trying to learn, I decided to reinstall Mac OSX El Capitan on my Macbook Pro and start installing and configuring stuff from ...
0
votes
0answers
15 views

Using profiles for terminals at the same time

I want to be able to use Terminal (I am using iTerm2 and Oh My ZSH) just like Google Chrome, where I have several profiles so I can use different extensions and all my logins and history is kept ...
1
vote
0answers
21 views

Scroll to bottom on new output

I have a script doing some monitoring tasks. It will print a line every once in a while if some background event happens. As of now, if I am scrolling back with iTerm2, new lines from my shell ...
0
votes
0answers
103 views

port sdkman installation from bash to zsh

Preamble I have installed sdkman on my bash terminal on Mac OSX which worked perfectly. I recently switched to zsh+iterm2+oh-my-zsh and, sdkman and the utilities I installed using it are not working. ...
1
vote
4answers
151 views

Run command on single file when changed with some shell magic (e.g replace extension)

I am writing several .gv files (graphviz) in the same directory and want to create a png file with neato immediately when I have saved one of them. I am on macOS 10.12.6, with zsh as my default shell, ...
3
votes
1answer
86 views

Return from emulate bash unsets zsh opts

So I have some setup scripts at work, which only work with bash (because they use e.g. == or $BASH_SOURCE). It works to source these scripts using zsh's emulate command: emulate bash source ...
0
votes
0answers
209 views

Changing WSL display color for agnoster zsh

I have been breaking my head in using the agnoster theme in zsh. the README says to check echo "\ue0b0 \u00b1 \ue0a0 \u27a6 \u2718 \u26a1 \u2699" which provides the following output I cant ...
1
vote
1answer
223 views

ALT+left-arrow & ALT+right-arrow not working in tmux (zsh) on Mac OSX

I've configured my zsh to use ALT and left/right arrows to word left/right using the following in my ~/.zshrc file, however when I open a tmux session it doesn't work and just outputs 'D' or 'C'… ...
0
votes
1answer
212 views

msys2 `which` is very slow on windows 10

The which command was never particularly fast, but since I switched to Windows 10, it is extremely slow. I have a generic .zshrc that I carry around, so it tests to see if some programs are available ...
2
votes
1answer
95 views

execute function in different shell

I usually zsh. I want to execute a function in bash and return back to my original shell. I can do this manually, but I want to automate it. How can I do that? For example, I am on zsh. I want to ...
0
votes
1answer
3k views

What is the right way to set $PATH variable in zshrc

When I first install zsh(oh-my-zsh), the ~/.zshrc file has the following lines by default - # If you come from bash you might have to change your $PATH. # export PATH=$HOME/bin:/usr/local/bin:$PATH ...
1
vote
1answer
71 views

PS1 as ghost text?

How exactly would I go from taking the value of $PS1 and putting the delimiter first with the text in the background? I received a suggestion to output the text to the terminal and then send len(...
0
votes
1answer
262 views

How can I navigate terminal output like a text file with Vim keybinding?

I use Neovim which has a really cool feature where if I type :terminal it loads a terminal emulator inside Neovim. The interesting thing about this terminal emulator is that at any time I can type ...