Questions tagged [zsh]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
7 views

Is there an equivalent of Ctrl-R but for single arguments, rather than whole commands (zsh)?

I use CtrlR constantly to search for previous commands that I've run and then edit them. I also regularly use Alt. to cycle through the last argument of previous commands. I'd like to have something ...
0
votes
1answer
9 views

How to access highlighted text with pbcopy?

How can I "catch" text that has been selected (highlighted) via shell script? It was suggested to use pbcopy. The script would be idle in the background and when a certain key combination is pressed ...
0
votes
2answers
17 views

Why does ASH return 'Permission denied' when typing `..`?

In ZSH, .. is equivalent to cd .. thanks to auto_cd, which, if I had to guess (I'm totally guessing) is some kind of alias. However, in many other *sh'es (ash, bash at least), this functionality is ...
0
votes
1answer
30 views

Does zsh have an equivalent to bash's “history -c”?

I'm administrating a linux server of a club, but I'm not the only admin. All admins log in as root. Please don't ask me why, it was the majority decision of the other admins. I know that this is not ...
1
vote
1answer
31 views

“no matches found” error when using youtube-dl

OK so I am just getting started with the command line stuff so I am guessing this is really a very noob question: I downloaded the youtube-dl according to this post https://ytdl-org.github.io/youtube-...
0
votes
0answers
21 views

How to pad a zero before the time prompt in zsh?

I was trying to pad a zero for single digit hour in zsh prompt currently I am sourcing ~/.bashrc in ~/.zshrc like the following source ~/.bashrc and the sourced ~/.bashrc file looks like export ...
0
votes
1answer
23 views

Get the same bash time command format of MacOS in zsh on Debian 10 Buster

From the following link change format for time command, I would like to get exactly the same format of MacOS Catalina time command present in bash into zsh of Debian 10 Buster. So, I tested the ...
0
votes
2answers
21 views

How to map Option-Shift-digit keys in zsh using bindkey

I am running zsh inside tmux inside Visual Studio Code integrated terminal. I have a Swedish Keyboard and I am on a Macbook running macOS 10.15.4 Catalina. To get keys like meta-f and meta-d to work ...
1
vote
1answer
28 views

What is the difference in ZSH between backward-kill-word and backward-delete-word?

Both seem to function similarly and the documentation states that the difference is that one 'deletes' the word and the other 'kills' the word. What is the difference?
0
votes
1answer
20 views

How to export hash -d directories to scripts?

I like to use hash -d. I want to use the hashed directories in a script. example: #!/usr/bin/env zsh echo $SHLVL hash -d echo "+++++++" ls ~dd Running: hash -d dd=/tmp hash -d echo "-----" ./...
2
votes
2answers
33 views

Where's the system-wide zshrc file located on macOS?

What's the location of the system-wide zshrc file on macOS?
0
votes
0answers
14 views

Blocking certain git commands in macOS terminal

I'm using zsh on a macOS terminal. I would like to block certain commands, particularly git commands, to prevent myself from accidentally running them. For example, I would like to block my terminal ...
0
votes
1answer
24 views

Mac - new terminal takes an unexpectedly large amount of time to open

I have observed lately that my bash takes a large amount of time to open. It seems it is running some commands in the background. I am using Oh My ZSH framework for the terminal. On the new terminal ...
0
votes
0answers
14 views

zsh tab autosuggestions not working with pdf

When I type open -n -a Preview.app in zsh, pressing tab for for autosuggestion of the pdf files does not return anything. Autosuggestion works just fine for other apps. Skim does not work either, but ...
0
votes
1answer
93 views

zsh compinit: insecure directories, run compaudit for list

After I installed nvm locally, it auto added paths to .bash_profile file. But my default terminal use .zshrc so I copied those path over. Everytime I fire terminal after above change, terminal auto ...
2
votes
1answer
48 views

Running python script without typing its `.py` extension

I'm using Zsh on MacOS Catalina. I was reading Automate the Boring Stuff with Python and in it the author runs mapIt.py simply by typing mapit into the terminal. In order to do this I added a ...
0
votes
0answers
116 views

Anaconda on machine but conda command not found

I haven't used Anaconda in a while, I typed conda info into iTerm2 to read this error: zsh: command not found: conda I have copied the relevant .bashrc file information into the .zshrc file and still ...
0
votes
1answer
13 views

Zsh not picking up new executable in PATH

So, I see https://superuser.com/a/1089956/954104 and have tried the guidance there. % which ndjsonMover.js /Users/marvin/git/internal/tools/scripts/./js/ndjsonMover.js % ls -l /Users/marvin/git/...
0
votes
1answer
27 views

Installed redoc-cli npm package but on trying to run it, it says command not found. macOS 10.15.4

Here's what I have done. See the last line for the error: cb-machan@cb-machan bin % npm i redoc-cli > styled-components@4.4.1 postinstall /usr/local/bin/node_modules/styled-components > node ./...
0
votes
1answer
95 views

Sorting almost-duplicate lines by their share of identical beginning characters

Is there a *nix tool/way to show each two lines (possibly adjacent via sort) that are almost duplicate top-ordered by the number of similar characters in same positions between each of those to lines ?...
2
votes
1answer
28 views

Newline (\n) handled differently by zsh vs bash - how to fix?

If I run the script below using zsh and bash, I'm getting different results. Interestingly, this is caused by the \n newlines in the input string. Using zsh, I get the correct result: rene@MININT-...
0
votes
0answers
22 views

Stuck in zsh command trying to load .bash_profile after switching from bash on MacOS

I've just switched from bash to zsh on MacOS and I wanted to load my current .bash_profile so I did: Added #!/bin/zsh to my .bash_profile and ran: % . ~/.bash_profile And I was stuck because of ...
-1
votes
1answer
32 views

How come I'm having trouble cp this file to another directory?

cp fanpage.html path/Desktop I am using this command to cp the fanpage.html file from my prework-about-me directory to my Desktop directory. When I run the exact command I posted here how come it ...
0
votes
0answers
10 views

External keyboard startup script

I want to have a script in my Autostart that sets the keyboard layout according to if there is an external keyboard connected or not. Is there an elegant way to do this? I'm on Manjaro.
2
votes
0answers
22 views

zsh - Is it possible to run he same command twice with slight modifications?

I would like to know if there is a zsh pattern (or bash command) for running the same command in multiple versions, eg.: somelongcommandwithargs {a, b} furtherargs # Some magic syntax represented ...
2
votes
1answer
50 views

Comparing two strings in zsh

I've been looking everywhere for what should be a simple example. First time trying to script something for zsh now that MacOS has switched over to it as default - how do I compare two strings in an ...
0
votes
0answers
20 views

Why is the oh-my-zsh theme displayed differently on a normal terminal and on Phpstorm's built-in terminal?

I'm on Linux Ubuntu 19.10 and I use ZSH shell with oh-my-zsh framework. When I'm in the built-in terminal of PhpStorm (which uses Zsh as I configured it to), the little "triangles" of the oh-my-zsh ...
1
vote
0answers
37 views

Changing the colors of zsh syntax highlighting - Robbyrussel theme

Does anyone know how to remove the directory highlighting in ZSH with the robbyrussel theme? This issue is driving me mad lately. Some directories (not all) are being randomly highlighted, and in ...
0
votes
0answers
10 views

How can I show git rebase steps in Zsh shell?

I'm on Linux Ubuntu 19.10 and I use ZSH shell with oh-my-zsh framework. When I'm in a rebase, I would like the number of steps to be displayed. How could I do that? What I have on ZSH: What I would ...
1
vote
1answer
33 views

How or where to define global functions to be used in bash, zsh, sh scripts?

Say I have these three script files: (all 3 are executable) bash-test.sh: #!/bin/bash HelloFromBash RocketNuts zsh-test.sh: #!/bin/zsh HelloFromZsh RocketNuts sh-test.sh: #!/bin/sh HelloFromSh ...
0
votes
1answer
51 views

Unable to revert default shell from zsh to bash in macOS/Catalina: “chsh: no changes made”

I have a new catalina system and need compatibility with traditional linux. bash is a must. Following various references I did chsh -s /bin/bash But not too happy: (base) 19:44:28// $chsh -s /...
1
vote
1answer
23 views

Finish command from history

A couple of years ago I enabled "finish text" command on iTerm2 + ZSH. For example, if I had "git commit" in my command history in a new command window if I typed "gi" "t history" would be viewable ...
1
vote
0answers
19 views

How to solve “prompt_skwp_precmd…” error

It shows me this message line everytime I type something in the Shell.: eg.: $ which ruby /home/felipe/.asdf/shims/ruby prompt_skwp_precmd:12: ruby-info: function definition file not found eg.: $ ...
2
votes
1answer
61 views

Recalling last command inserts spurious character at the beginning (in Zsh)

The interactions are so complex that I don't know exactly what I'm looking for, but maybe you can still help. Sometimes, generally after an error (return code > 0), when recalling some last command, ...
0
votes
0answers
22 views

zsh hook delays the exit of commands

Suddenly I notice the every command exits with a delay(1 or 2 seconds) after running it in zsh with oh-my-zsh. I also observe the git command always is ran after the command I executed(such as ls) ...
0
votes
1answer
85 views

How to make git branch name fullly showing? Zsh, with POWERLEVEL9K

I had shortened current path name. but I want to see whole git branch name. How can I do it? My setting for .zshrc file POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(time context dir vcs) ...
2
votes
1answer
44 views

Key binding to go up by one directory (in Bash)

In Zsh, I have a key binding to go up by one directory (very useful): # C-M-u: up-directory up-directory() { builtin cd .. && zle reset-prompt } zle -N up-directory bindkey '\e\C-u' up-...
1
vote
0answers
21 views

Bash and Zsh profile confusion

I'm on a mac and am about to start developing, did a clean install on my mac just but my question is what is the difference between ~/.bash_profile, ~/.zshrc, ~/.profile, and ~/.bashrc and where can I ...
0
votes
0answers
36 views

Tmux always shows hostname instead of application running

A weird thing is happening. I have been trying to debug it for 2 days with no luck. Nothing relevant around forums as well. I have just set up my wife's machine because I need to work remotely. I ...
0
votes
2answers
98 views

How to save history between zsh terminals?

I do some work in a single terminal tab: > ls > ps Then I close the terminal, and open a new terminal, and run history > history 1 history My .zsh file looks like this setopt ...
0
votes
0answers
22 views

How do I get ZSH to use the colors of my terminal?

I'm in the process of switching over from bash to zsh. My old bash prompt looked something like this: PROMPT_COMMAND=ps1_command ps1_command() { ext="$?" PS1="" if [ "$ext" != 0 ]; then ...
0
votes
2answers
53 views

Macos - zsh - Unknown and undeletable file: <!--

I have recently noticed a file that I have not intentionally created, appearing in directories with files I have intentionally created: <!-- The file contents change depending on location, but is ...
0
votes
0answers
17 views

Special characters and glyphs in xterm

Hello fellow people of the internet, I come to you today because i have an issue that i can't solve. I recently installed zsh and oh-my-zsh, and to use its beautiful set of theme, i need my xterm to ...
0
votes
0answers
30 views

Zsh prompt doesn't print arrows and other special character

I installed zsh on my arch setup (i use Xorg and Xterm) and oh-my-zsh. However, when i select a prompt such as 'agnoster', it does not display special characters, like the cross, or even the arrows ...
0
votes
0answers
20 views

How is it possible to only add succeeded commands to saved shell history? [duplicate]

I'm a poor touch typist and keep running commands with typos. They fail, and I don't want that garbage in history. How to persist only succeeded commands in the command history, so that ^R/zsh-...
0
votes
0answers
19 views

Cygwin+zsh terminal issue for directory with git repo only

I have Cygwin with zsh, and I am using git from cygwin, not the Windows one. The issue is when I am under the directory which is a git repo, my command does not terminate FYI: I have cygwin + zsh + ...
0
votes
0answers
29 views

Get back to bash from zsh [duplicate]

I want my bash back. zsh is fully broken concerning key bindings. Home/Pos1, End, wordwise left/right,... they all don't work properly. How do I get my bash back as default shell in MacOS 10.15? ...
0
votes
0answers
49 views

How to search backwards in zsh/bash BUT relative to directory

Problem: In the terminal, when I press Ctrl+R to do a backward-search using the zsh/bash history, it searches all commands sorted by most recently used. Problem is some commands are completely ...
0
votes
1answer
50 views

Terminal autocompletion freezes the UI on a fresh Ubuntu

I've just installed Ubuntu 18.04 on a pretty powerful desktop. When I open the terminal and type ls /<TAB><TAB> The cursor stops blinking and the whole UI is frozen. Only the mouse can ...
0
votes
0answers
23 views

iterm2 + zsh cursor moving is broken (Home/Pos1, End, left right)

https://gitlab.com/gnachman/iterm2/issues/8743 Pressing HOME/POS1 key is supposed to move the cursor to the beginning of the line. Actual behaviour: nothing happens. Same for END key. Wordwise left ...

1
2 3 4 5
22