Questions tagged [zsh]
Zsh is a shell designed for interactive use, although it is also a powerful scripting language.
1,358
questions
0
votes
0
answers
16
views
How to disable suggest directories zsh
zsh automatically suggests directories in the current working directory.
How to disable it?
1
vote
1
answer
58
views
Change the default location of zsh completion cache files for macOS
I'm trying to change the default location of the zsh completion cache files in macOS. I have read the zsh documentation on completion which say's "alternatively, an explicit file name can be ...
1
vote
0
answers
38
views
bindkey to Alt + Shift + p has no effect
Capital p with Alt and Shift no longer seem to register as keystroes on my Mac OS with iTerm 2 (or Terminal). Therefore this key has no effect:
bindkey -s "^[P" "echo 'I cannot trigger ...
1
vote
0
answers
34
views
What is the difference between different options for 'ls' colored output in zsh?
I want to display colored output for the 'ls' command in the terminal for my MAC but I do not understand the differences between some of the methods. On some articles and reddit posts I saw people ...
0
votes
1
answer
47
views
Bind command not found in Linux Mint/Ubuntu terminal
I need to use this "bind" command described in articles like:
https://www.computerhope.com/unix/bash/bind.htm
https://www.gnu.org/software/bash/manual/html_node/Bash-Builtins.html#Bash-...
1
vote
1
answer
45
views
Ctrl-C not working on MacOS/Zsh
I have a similar problem to Ctrl-C Not working in zsh
But it is not the stty setting or the key-bindings.
It definitely happened in one terminal, while on others it works.
I get: from stty:
eol2 = <...
0
votes
1
answer
21
views
I'm not sure how to insert "path to this file" in a source command. I want to forward source commands without using a hardcoded fully qualified path
What I'm trying to do should be simple. Yet it's just not working.
I have a repo with my dot files. I want to be able to clone this repo anywhere in my system, and just source one single file. I then ...
0
votes
0
answers
25
views
Prevent double clicked SH script from being entered into ZSH history on Mac [migrated]
I've got some SH scripts which I double click to run. The scripts run as intended, after having set the working directory via cd "$(dirname "$0")" at the beginning of the script, ...
1
vote
1
answer
34
views
zsh completion ( compctl ) does not trig for command names containing dashes
I've used zsh compctl since forever (late 90s or early 00s) but strangly never run into this before.
I realized today when I intended to make some compctl config for update-alternatives that my ...
1
vote
0
answers
91
views
Speed Up Zsh Loading Time in tmux
Like many users, I'm experiencing slow load up times with my shell on macOS.
I've seen many questions about this topic, and I'm using a suggested workaround, which is setting the terminal emulator (...
1
vote
1
answer
36
views
How to hide the directory in prompt if directory has no change?
Can the prompt be hidden if the directory has no change after the last command executed? Show only the $, show the path only if the directory was changed in the last command.
My ps1:
precmd () { ...
1
vote
1
answer
246
views
How do I prevent Conda from activating the base environment by default? Want to use oh-my-zsh
I cloned this directory 'git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
' and afterwards, I typed in this command 'open ~/....
0
votes
1
answer
35
views
Streaming outputs to another window without running the same commands again on iterm2
First of all, I think every command running consumes some resources.
So if I'd like to have another window displaying the same output of the same commands being run on another session without running ...
1
vote
0
answers
68
views
Bug with tmux status bar and terminal lines in zsh and MacOS
I have a bug in my tmux. The status bar randomly transform into two rows (see image below) or disappear completely.
Also, some lines of the terminal command disappear. See image below where the last ...
0
votes
0
answers
43
views
zsh tab-completion does not work for my own /lib/systemd/system services
In my Ubuntu 20.04 focal environment, zsh tab-completion is not working for my own /lib/systemd/system services.
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: ...
0
votes
0
answers
15
views
Custom colors on the GNU screen hardstatus bar?
I want to pimp my GNU Screen hardstatus bar with custom colors, however the GNU Screen documentation seems to suggest that the hardstatus bar is limited to 8 colors (in light/dark variants).
Is there ...
3
votes
0
answers
45
views
Not able to set lang to CN in zsh macOS, but locale is good. The word “total” is still shown in English
~/.zshrc:
export LANG="zh_CN.UTF-8"
export LANGUAGE="zh_CN.UTF-8"
export LC_COLLATE="zh_CN.UTF-8"
export LC_CTYPE="zh_CN.UTF-8"
export LC_MESSAGES="zh_CN....
0
votes
1
answer
27
views
How to pass zsh string without escaping # sign?
As title. I'm a user of zsh and I often read posts saying something like this:
nix profile install nixpkgs#hello
but I need to add quotes to the last argument to avoid this error:
zsh: no matches ...
0
votes
1
answer
183
views
How do you move (mv) in ZSH all files from current directory except two or more to a child directory?
(There is plenty of information about this on bash, but much less on zsh and NOT AT ALL for TWO or more files. No idea how to apply the ^ ("caret") TO MORE THAN ONE FILE).
I want to know (...
0
votes
1
answer
669
views
zsh: event not found: /bin/bash
When I run the following on my command line #!/bin/bash I get the error zsh: event not found: /bin/bash.
I'm on Mac Ventura.
If I run zsh the command works fine, so the issue is with /bin/bash.
Does ...
0
votes
0
answers
170
views
MobaXterm builtin shell (zsh/bash 64bit) strange behavoiur
Using builtin terminal from MobaXterm, and executing commands like curl or ssh works couple of times and later produce no output at all. Anyone had similar experience? My problems started after ...
1
vote
2
answers
79
views
How to handle triple-nested quotes in Zsh? [duplicate]
I've been setting an alias that running Apple Script on Terminal. As below:
alias playda="osascript -e 'tell application "QuickTime Player"
activate
set thisFile to open POSIX ...
0
votes
1
answer
123
views
Remove ZLE commands from zsh autocomplete
I've set up zsh completion to be case-insensitive, and I use the autocd option, so when I type downl<Tab><Enter> I will cd Downloads/. Great! However, if I just type dow, zsh will instead ...
3
votes
1
answer
371
views
How to activate ZLE (ZSH Line Editor)
How do I activate ZLE, the ZSH line editor?
I am trying to enable the local history in ZSH. I've added zle set-local-history 1 to my ~/.zshrc, but it prints the error: widgets can only be called when ...
0
votes
1
answer
74
views
How to set-local-history on zsh startup?
Calling zle set-local-history 1 from .zshrc causes
widgets can only be called when ZLE is active
Is there a way to execute the widget on startup, or maybe a setting for this particular case?
upd: I ...
1
vote
0
answers
49
views
Run bundle with sudo in MacOS .app bundle
I have a MacOS app that I want to deploy as .app bundle. The binary in this bundle is needed to run with root priveleges.
I made launcher zsh script in Contents/MacOS with line sudo ./MyApp. I changed ...
0
votes
1
answer
97
views
Randomly lost ZSH prompt settings
Yesterday I suddenly lost all my ZSH settings more specifically the prompt and how the themes as they are applied. I've tried the following so far:
As suggested in the ZSH FAQs, I tried exec zsh but ...
0
votes
1
answer
538
views
Oh My ZSH - Show home path instead of tilde
My terminal now shows
name@host:~/path/to/some/file
I want to change ~ to /users/name/path/to/some/file
The .zshrc file doesn't have PS1 and even though I tried adding one with $PWD (setting PS1 to \u@...
0
votes
1
answer
486
views
What files do I need to move for zsh + oh-my-zsh if I migrate to a new machine?
New machine and I went looking for instructions for this and didn't find any. I'm sure I need to move over my .zprofile and .zshrc, anything else? I have the old machine still.
Bonus: also using oh-my-...
0
votes
0
answers
165
views
-bash: command not found in macOS 12.6.3. How can I fix this?
I am a new to macOS and I am using an the iMac running macOS 12.6.3 (Monterey) I am trying to load pygame.
I have already loaded python 3.11 and pycharm. Every time I try to load pygame I keep ...
0
votes
2
answers
63
views
How to copy output from a zsh terminal using vi movements(or if that's not possible any other way)?
Currently I am using vi motions in zsh and it is incredible. I work on terminal a lot and it is annoying to switch back to move to copy an output. Is there a way to use vi motions or anything else to ...
3
votes
1
answer
57
views
Possible to get Bash like tab completion in ZSH?
If you do the following in Bash
$ touch b bb bbb
$ ls b* # press tab twice
b bb bbb
If you do the same in ZSH you get
➜ ls b bb bbb
ZSH expand the matches to the command and hence removes ...
1
vote
1
answer
118
views
How do I print a newline after there user enters a password with zshbuiltin read command
I want to read a user's password securely within the execution of a curl command. A made a basic proof of concept which mostly works, but the output of the echo command is coming on the same line as ...
1
vote
0
answers
36
views
How to make zsh ignore undefined escape sequences?
Is there a way to make zsh ignore all undefined escape sequences, including things like F1 which is ^[[15~ and usually causes a ~ to be inserted.
To be more precise, I'd like all characters that are ...
2
votes
1
answer
60
views
Kubuntu: zsh and firefox in conflict
I have a fresh install of Kubuntu on my notebook. I have downloaded zsh through apt and changed the default shell to zsh from bash, using chsh -s. I have not downloaded .oh-my-zsh, and I have not ...
1
vote
0
answers
53
views
$RANDOM, not so random [duplicate]
I want to print out a random number and encrypt it, like so: echo $RANDOM | sha256sum.
I would expect this to take the standard output of echo $RANDOM and pipe it into the encryption function. However ...
0
votes
1
answer
108
views
ZSH Terminal: Can't find tmux.cnf file
I've installed Tmux in my Arch Linux GNOME system and for changing keybinds. I need to configure .tmux.cnf, but I can't find it. I searched for ~/.tmux.cnf, /etc/tmux.cnf or /etc/.tmux.cnf and seeing ...
3
votes
0
answers
352
views
Tips on how to speed up ZSH shell start up time
can someone help me understand why my Zsh start up is so slow. My Zsh takes up to six 6 seconds to start up so I added zmodload zsh/zprof and zprof to my .zshrc to see what takes the most time. The ...
0
votes
1
answer
288
views
Cannot find source of PATH variable in zsh
I wanted to change $PATH and I did not pay attention to shell, so I changed $PATH in .bashrc instead and not in the dotfile for zsh. Now when I wanted to find it and change it, I cannot find any file ...
1
vote
1
answer
80
views
Select given "word" in Zsh currently being typed command line
In Zsh (non Vim editing mode) how can I repeat a given word on the currently being typed command? For example, I can extract all that was typed to this point with !#:
mv /example !#
Becomes
mv /...
0
votes
1
answer
318
views
powerlevel10k slanted theme not aligned in VSCode integrated terminal
I have powerlevel10k installed on my zsh.
On VSCode integrated terminal, the slanted theme is not aligned properly, even with MesloLGS NF font installed and terminal.integrated.fontfamily set to ...
2
votes
1
answer
555
views
Configure Visual Studio Code to share same terminal history from zsh?
I use both the built-in terminal of VScode + terminal (zsh) on Mac. I'm under the impression they used to share the same history but not anymore.
Ideally a command I type in either would be ...
0
votes
1
answer
30
views
My migrated zsh terminal looks werid
I migrated my zsh setup to another machine, but it looks weird, instead of regular "UI" look I see weird symbols
✔ 13s name@damain 16:30:23
what might be the problem?
4
votes
3
answers
947
views
Copying a path in the terminal with the keyboard
I often find that when using the command line, I need to copy a path that appears in the output of the last command. For example I might use find . | grep like this:
[user@localhost /tmp]$ find . | ...
0
votes
1
answer
21
views
Ways to to detect whether a background task is completed in Linux/BSD
I have a script that does several things, one of which depends on availability of a local mount of a remove directory. The first command in the script makes sure the remote disk is locally mounted by ...
1
vote
1
answer
99
views
how to solve that zsh terminal cannot find any command?
I guess I made some mistake when I set environment path setting in zsrhc file. After that I cannot use any command in terminal even basic command like ls, pwd, cal, man, git ...... only able to use cd,...
1
vote
1
answer
82
views
Best way to detect that a ZSH scope runs inside a VScode's Terminal?
When I run build commands in Visual Studio Code I want to invoke my whole custom shell that I also use for macOS, thus I invoke;
source ~/.zshrc && sync_all_shell_env
There is a small problem ...
0
votes
2
answers
374
views
How can I disable case-insensitive tab completion in zsh?
If I have a Music folder and a monitor.sh script, I want $ ./m\t to autocomplete to monitor.sh, but it's also listing the Music folder as a suggestion. How can I disable this 'feature'?
I have ...
0
votes
0
answers
103
views
Opening new window with modifications [i3]
Is there any way to open a new app and automatically rearrange it's placement on a workspace?
The following is needed:
On current workspace - run one command (alias)
Then in the background on another ...
0
votes
0
answers
225
views
Ubuntu 22 - zsh: command not found: lessc
OS: Ubuntu 22.04.1 LTS
zsh 5.8.1 (x86_64-ubuntu-linux-gnu)
Before installing oh-my-zsh everything worked, now I have issues.
One of the issues is zsh: command not found: lessc, but who knows how many ...