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
29 views

zsh sometimes doesn't show stdout

When I have a command that generates a lot into stdout zsh recently (last 6 months AFAIR) stopped showing the output. e.g. when I do a: for i in `seq 2000`; do echo AAA; done I don't get any output,...
0
votes
0answers
11 views

How to add ~/.zshrc file into git?

I would like to create a backup of the .zshrc file in my ~/ directory and avoid versioning all other items. How to exclude all subdirectories and their content? For example: cd ~/subdirectory/ &&...
0
votes
0answers
12 views

In mac osx, I'm trying to write a spinner that takes in a command and spins while running it

The usage would be for long commands called from the command line programatically. In my case php will be calling yarn update. If there is a space in the command I can't figure out how to run it. I'...
0
votes
0answers
16 views

Oh my ZSH no unicode characters

I installed Arch Linux on my work computer and I'm currently configuring it for my taste. I installed the packages I needed (Xorg, Gnome3, urxvt, etc.) and created those dot files: .xinitrc export ...
0
votes
1answer
21 views

Ctrl+b appearing as '^B' at command line

I noticed this behavior in tmux, but it also happens when I have no session attached. Instead of entering as the command key binding Ctrl+b, ^B is printed to the command line. I don't have a .tmux....
0
votes
1answer
77 views

What is the recommended way of managing environment variables in Unix systems? [closed]

I have always been thinking about the effective way of managing environment variables in operating systems like Ubuntu, macOS, etc.. I have a couple of questions related to it. Is there a common ...
1
vote
0answers
24 views

How do I change or remove an alias in Zsh in MacOS? [duplicate]

I am trying to install a build tool on my Mac called please; however it seems the word "please" is already aliased to "sudo" and I don't know where that alias is being set. I'm using Oh My Zsh which ...
0
votes
0answers
18 views

How to rebase a branch from previous fork in one command?

So I'm trying to come up with a ZSH alias for Git that will rebase my current branch onto the branch it was originally derived (forked) from. Examples: Given the following branch names of A and B. ...
1
vote
0answers
39 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
49 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
2answers
50 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.
1
vote
1answer
48 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
21 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
36 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
201 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
36 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
1answer
35 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
34 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. ...
1
vote
1answer
45 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
40 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
36 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
277 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
149 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
161 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
56 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
161 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
40 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
406 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
73 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
100 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
665 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
63 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
138 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
165 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
167 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
89 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
35 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
121 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
857 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
425 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
522 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
286 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
347 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
16 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
23 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
140 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
224 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
102 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 ...