Questions tagged [zsh]

The Z shell (Zsh) is a Unix shell that can be used as an interactive login shell and as a powerful command interpreter for shell scripting.

0
votes
0answers
19 views

Why is the Path I added to zshrc only work when I switch to bash and then switch back?

I try to run conda in my mac terminal, typing in export PATH=$PATH:$HOME/anaconda/bin clearly worked. However, after I put the path in .zshrc and sourced it, it did not work at the first time. Then I ...
0
votes
0answers
19 views

Run shell script from init.vim on MacOS System theme switch

I use Alacritty as my terminal and have a script that switches my color theme with sed. I'm trying to use those theme switching commands (or rather, their aliases) in my init.vim, so that they ...
0
votes
0answers
50 views

How can the terminal change between zsh and bash when I chabge the location? [closed]

By default my terminal is ZSH, and I need to change a BASH only when I move the location to ~/Repos y the sudirectories in this folder, but when I leave ~/Repos I need to return to use ZSH. Example: ...
-2
votes
0answers
26 views

Selecting a field in JQ works when reading from a file fails on the shell

I have the following JSON output from a command. [ { "userId": "abc@xyz.com", "firstname": "Tyrion", "lastname": "Lannister", "state": "ACTIVE" }, { "userId": "def@xyz.com", ...
0
votes
1answer
13 views

bad options -t shell integration bash

$PATH/.iterm2_shell_integration.bash:type:257: bad option: -t . how to fix that error? I use zsh. i've tried to re-install zsh and commented it out the line 257 but it won't work. code is built ...
0
votes
1answer
10 views

Zsh inherit xtrace option

Similar to this question: bash recursive xtrace, but for Zsh. How can I make all the Zsh subshells inherit the xtrace option? For example, if script1.sh is calling ./script2.sh and I run zsh -x ...
1
vote
3answers
68 views

Make last command stick to top of terminal window while output scrolls normally

I want to print what command is running and in what directory always as the top line of the window, even if the output from the command would normally cause it to scroll away. I'd like the normal ...
0
votes
0answers
15 views

Is there a way to invoke from a Makefile a custom Zsh function compiled into a digest?

I developed a simple Zsh function and compiled it into a zwc digest file. I already have the zwc digest file path in FPATH (i.e. fpath). I've tried setting the SHELL variable as /usr/bin/zsh but the ...
1
vote
2answers
65 views

Shell script - Assign jq array output to SHELL array

I am using jq like below to parse a json file - The json file looks something like - { "values": [ { "email": "user1@domain.com", "id": "USER1_ID" },{ "email": "user2@...
0
votes
0answers
31 views

Autocomplete s3 paths using zsh

I would like to autocomplete while writing s3 paths in my terminal. Any path would start by s3://... and possibly end with / if that makes things easier. That would autocomplete with all the files or ...
0
votes
1answer
17 views

How to make a permanent zsh alias in command-line?

I want to permanently store zsh aliases. When I make an alias and shut down ITerm and reopen and it's gone! alias mkcd="function _mkcd(){mkdir "$1"; cd "$1"} _mkcd" mkcd Ken zsh: command not found: ...
1
vote
1answer
25 views

Unable to install a python package on zsh but successful on bash

I want to install papermill[s3] using pip. The command indicated in the traceback is: pip install papermill[s3]. However, when I run the command: pip3 install papermill[s3], I get a following ...
0
votes
1answer
23 views

mixing process substitution and pipes in zsh

Using ZSH, I am trying to wrap a sed command into a function, then use it, while mixing pipes with process substution. Let me explain with an example: $ echo "test text" | gzip > myfile.gz $ sed $'...
0
votes
0answers
33 views

How completion “git add” full path in zsh?

Git add not list all file, only give a layer of a layer to choose file. Such as └── src └── main └── java └── com ├── A.java └── B.java if ...
0
votes
0answers
12 views

Enable alias unfolding in command's suggestion

I would like to have alias unfolding in command's suggestions, when invoked in zsh (I'm using oh-my-zsh), to be able to use in full built-in aliasses. So I.m expecting something like this: gca<...
0
votes
2answers
33 views

how to select all items in zsh?

in bash, we can say dnf install <some-pkg>-* or rm -rf *.jpg but when I'm using zsh, it doesn't do anything with the star (*) character! how can I do those commands on zsh?!
1
vote
1answer
44 views

How to get all parent process names of a set of child processes (in macOS) from the shell?

I need to extract and list all of the parent processes by name of a subprocess that has a certain name in macOS. I suspect this will work just fine in Linux or any other *nix as long as we ...
0
votes
0answers
16 views

mac terminal autocomplete strange behaviour

I have a strange behaviour with my autocomplete in terminal. When I type a initial matcher keyword e.g. sc and press TAB, it always leaves it as a fixed part of the keyword if I choose scala as the ...
0
votes
0answers
41 views

command not found for zsh

# If you come from bash you might have to change your $PATH. export PATH=$HOME/bin:/usr/local/bin:$PATH # Path to your oh-my-zsh installation. export ZSH=/Users/carlosgrijalva/.oh-my-zsh # Set name ...
0
votes
1answer
22 views

How can I avoid typing in the profile for aws each time?

I want to avoid typing --profile dev-platform every time I want to access the AWS cli commands. How do I add a postfix or suffix like --profile dev-platform every time I want to run an AWS command? ...
1
vote
1answer
22 views

Will creating functions starting with plus or minus (like `+project(){}`) cause unintended side effects?

This works but I don't know what the side effects are. Example creating & removing python virtualenv using virtualenvwrapper: +v() { mkvirtualenv --python=$(which python3) ${1:-${PWD##*/}} } -...
0
votes
1answer
17 views

zsh: create file and open in editor

Does anyone know of any neat shortcuts to create a file and open it in an editor (in my case Sublime) at the same time? Something like touch some/nice/file.txt | st ... or touch some/nice/file.txt &...
0
votes
0answers
28 views

ZSH: How to use bash_completion files?

I've trying to use a bash_completion file with zsh (and oh-my-zsh). Unfortunately this is not working... In my ~/.zshrc I have the following code: autoload -U +X compinit && compinit ...
0
votes
0answers
8 views

get more precision from zsh time command

I am timing things at the command line with zsh's time command but the precision is only to the nearest millisecond. How can I get a more precise timing than this? (without having to average e.g. ...
1
vote
1answer
23 views

zsh function to put arbitrary string into the line editor

I'd like to create a zsh-function that will put a computed string into the line editor, e.g. insert_foo() { # Do something that will put the string "foo" in the line editor } $ insert_foo $ foo # &...
1
vote
2answers
82 views

nest Command not found

I followed the documentation to create my first NestJS project. Installing the Nest CLI with the command npm i -g @nestjs/cli was successful. The output was: + @nestjs/cli@6.3.0 updated 1 package ...
0
votes
1answer
13 views

Parse error near `&' while setting Heroku config vars

I am setting my Heroku config variable through terminal, and get this error: zsh: parse error near `&' my zsh version is 5.7.1 platform: Mac Mojave Here is the command I'm running: heroku ...
0
votes
0answers
16 views

Visual Studio Code terminal isn't showing progress properly

I've tried searching up this problem to no avail; however, it's consistently been like this across many devices and many terminals, and most recently my zsh shell running inside of Visual Studio Code. ...
-1
votes
0answers
32 views

Why double quote lead to different behavior in zsh but not bash?

Following subsitution, with or without double quotes behaves differently in zsh 5.7.1. But show same result (abxef) in Bash4/5. $ a=ab{cd}ef $ echo ${a/{cd\}/x} braceparam> $ echo "${a/{cd\}/x}" ...
0
votes
1answer
18 views

What's the difference between -a and -e in a zsh conditional expression?

I was looking up the meaning of flags like -a in zsh if statements, eg. if [[ -a file.txt ]]; do # do something fi and I found this -a file true if file exists. -e file true if ...
1
vote
0answers
30 views

Using csc.exe to recursively find .cs files doesn't seem to work

I have the following CSC command: $ csc -out:dist/program.exe src/program/*.cs -recurse:*.cs This gives me the following error: no matches found: -recurse:*.cs Does anyone have any idea why the -...
0
votes
0answers
12 views

How to use zsh tab completion on Git without origin?

I am using zsh with oh-my-zsh on Ubuntu 18.04.2. Currently, Git is installed at version 2.20.1. Whenever I want to push a local branch to a remote (origin) I try to use the tab completion in the ...
0
votes
1answer
26 views

ZSH prompts [nyae] for changing git branch names

Every time I try to change the branch, I keep getting this prompt: > git checkout rc/v1.1.1 zsh: correct 'rc/v1.1.1' to 'src/v1.1.1' [nyae]? n It's kind of irritating to keep providing an input. ...
0
votes
1answer
26 views

How do I get bash.exe on Windows 10 to automatically open the zsh shell in IntelliJ instead of the regular bash shell

You can turn on Ubuntu and gain access to bash.exe in windows. You can install zsh and oh-my-zsh too Then, you can modify IntelliJ to use that bash script by going to Settings -> Tools -> Terminal. ...
0
votes
0answers
8 views

workon not working after install item2 and zsh

I previously using virtualenvwrapper and it works fine. workon virtualenvName will works. However, after I install iterm2, zsh, and oh-my-zsh, and suddenly virtualenvwrapper and workon is not ...
0
votes
0answers
42 views

zsh: command not found: atom

This seems to be happening randomly, but every once in a while my "atom ." command in order to open a directory in atom won't work. I run into the following terminal error - "zsh: command not found: ...
-1
votes
1answer
25 views

How to record each command's duration/result and display this information with `history`?

I have some commands that take a really long time to run. I'd like to be able to keep track of all of them in history. I've looked into history flags, but those seem to only show the time/date the ...
2
votes
2answers
42 views

Using “declare” in Zsh

I am following this thread: http://resolved-error.com/a/19742842/5057251 for typeset (or declare) in ZSH, not BASH. #Declare (or typeset) an array of integers #declare -ai int_array typeset -ai ...
0
votes
1answer
27 views

Colon with 'r' in string not working as desired under zsh

I try to run code under zsh a=123 b="$a:r" echo $b which I want the result to be 123:r, but it turns out to be 123 # without ":r" And the same thing for character t, q. However, if I run it under ...
0
votes
1answer
43 views

Why does the “kill” command work differently in bash and zsh

the -L flag provided in kill does not work in zsh. When I run the command kill -L Using zsh the result is: kill: unknown signal: SIGL kill: type kill -l for a list of signals Running kill -L Using ...
0
votes
1answer
37 views

Bash setup making me not have history in zsh

I am trying out zsh, but it's pretty terrible so far, as I don't have history at all (well, 1 single line). What in my bash setup is causing this - assuming that some variables are shared? ...
4
votes
1answer
392 views

Zsh “(eval):61: = not found” error after Anaconda update

I recently updated Anaconda (conda update --all) and I now see the following message in my zsh command line on opening: (eval):61: = not found Things still seem to work fine, I can call conda, etc., ...
0
votes
4answers
270 views

How to take first n rows of `ls` command

ls command outputs it's result by rows: AndroidSandbox/ kotlin-native-intellij/ arc-theme-macos/ kotlin-native-sandbox/ BobkoLauncher/ kotlin-...
10
votes
1answer
265 views

How do I defer shell completion to another command in bash and zsh?

I am attempting to write a shell script utility that wraps other shell utilities into a single CLI and am trying to get shell completion to work in zsh and bash. For example, let's say the CLI is ...
0
votes
1answer
42 views

Using CLASSPATH, Java and compiling from zsh

I'm trying to compile and run Java files from a workspace at the following directory: /Users/raph/Java/Workspace/COMP30820> Inside the directory are src and bin directories, and the src folder ...
0
votes
2answers
25 views

How does bash search for program if command is a result from subprocess program

I was just playing around a minute a ago in zsh, and I ran this and got confused `echo ls` it returned the stork ls result(I had ls an aliase in my .zshrc), no coloring, no sorting. I thought the ...
0
votes
1answer
17 views

How do I enforce changes in an oh-my-zsh function?

I'm trying to look into this issue, and figured out I would have to debug this function, but I cannot see any effect when changing or even removing that function, and that even after opening a new ...
0
votes
0answers
13 views

MacOS: iterm2, zsh cancelling process with control + c not working, but it works with control + m or control + shift + c

Ok, this is weird. My terminal (iterm2 with zsh) exits a command with control + m or control + shift + c now instead of only control + c. Any ideas on why this is happening? Thanks!
0
votes
1answer
21 views

How to change the default program run under zsh?

I have two versions of AWS SAM CLI installed on my MacOS. I got the following result when running where sam in zsh: $ where sam /Users/MyName/.pyenv/shims/sam /usr/local/bin/sam When running sam ...
0
votes
1answer
44 views

how to check the command name is “find” and exit prompt before command prompt in zsh

any can help me? original ➜ ~ find here preexec block... usage: find [-H | -L | -P] [-EXdsx] [-f path] path ... [expression] find [-H | -L | -P] [-EXdsx] -f path [path ...] [expression] I ...

http://mssss.yulina-kosm.ru