Questions tagged [zsh]
Zsh is a shell designed for interactive use, although it is also a powerful scripting language.
1,262
questions
0
votes
0
answers
3
views
How to use zsh in flatpak vscode
I have Visual Studio Code installed in flatpak, I run it with:
flatpak run --command=sh com.visualstudio.code
I want to change the shell to zsh, but I can't find how to, I tried multiple thing in my ...
0
votes
1
answer
21
views
"Command not found: complete" message appears every time I open the terminal
I was setting up my development environment on Ubuntu 20.04 following a video on Youtube and after running the command
$ echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.zshrc
Every time I ...
0
votes
0
answers
25
views
Zsh-like syntax highlighting on PowerShell
I've been using Zsh for a long time and have installed a syntax highlighting extension such that when I enter the name of a program that doesn't exist on the console, the text will automatically turn ...
1
vote
1
answer
33
views
/bin/sh: TexturePacker: command not found (while zsh works) macOS Monterey
I have a small Adobe Animate extension that uses TexturePacker to pack sprites onto sprite sheets. I've successfully added TexturePacker to $PATH (/Applications/TexturePacker.app/Contents/MacOS) so it ...
1
vote
1
answer
13
views
special characters not rendering well in zsh
I'm running rxvt-unicode, with zsh + ohmyzsh.
I just installed firacode, verified font name with fc-cache and set URxvt*font: xft:FiraCode in ~/.Xresources, and ran xrdb ~/.Xresources.
Then I ...
1
vote
1
answer
22
views
ZSH Colorize the PWD output in aliases
NOTE: Yes, This is on Mac OS 11.6.2 Big Sur.
Right now I have zsh aliases in the .zshrc file to make terminal navigation easier. I thought I'd try to colorize the PWD output, but what happens is that ...
0
votes
0
answers
10
views
Default directory for zsh (cygwin) terminal is home, not working directory VSCode on Windows
I have setup custom profile for zsh via Cygwin in VSCode as below:
"terminal.integrated.profiles.windows": {
"zsh": {
"path": "C:\\cygwin64\\bin\\bash....
1
vote
0
answers
12
views
zsh change RPROMPT time on enter
I have found resources on configuring zsh's right prompt (RPROMPT) to be the date and time and this works great.
However the time the prompt renders (after the last command) and the time that I press ...
0
votes
1
answer
72
views
How to automatically rename tmux window to an aliased command
I have set up multiple aliases to ssh to different servers
alias sa="ssh user1@server1"
alias sb="ssh user2@server2"
alias sc="ssh user3@server3"
When I run these ...
1
vote
1
answer
19
views
Is there a way to reach iCloud's Pages folder via the Terminal?
You can get to iCloud drive from the Terminal using cd ~/Library/Mobile\ Documents/com~apple~CloudDocs/, but that doesn't show you all the same folders you see when you click the iCloud Drive link in ...
0
votes
2
answers
12
views
Printing the KeyMap pressed in zsh/bash
Is there a way for zsh/bash to print out the keymap of the next received keystroke ?
I would press a key combination on my keyboard, and it would print, say
keymap :
^A
0
votes
0
answers
7
views
What are some options to emphasize/indicate line breaks and/or soft-wraps in zsh?
Sometimes when a lot of data comes through stdout at once in the terminal, it can be confusing to sort out when a line break occurs. I am looking for a solution that would emphasize when soft-wraps ...
0
votes
0
answers
14
views
aliases for terminal commands not loading on session start [duplicate]
my ~/.bashrc and ~/.zshrc both files have following aliases
# exa to ls
alias l='exa'
alias la='exa -a'
alias ll='exa -lah'
alias ls='exa --grid --color=auto --icons'
# bat alias to cat
alias cat='...
0
votes
0
answers
10
views
Wildcard (*) is not matching files in another user's folders in zsh on macOS [duplicate]
Logged in as user 1, I am trying to delete all files in a folder belong to user 2, using * as a wildcard. I know there is a file in the folder.
% sudo ls /Users/Guest/Documents
.localized file
% ...
2
votes
1
answer
52
views
Bash or zsh conditional patterns and variable expansions
Suppose I want to generate a filename based on some given variables.
track=01
title="Some title"
album="Some album"
echo ${track}. ${title} (${album})
-> 01. Some title (Some ...
0
votes
0
answers
26
views
zsh-autosuggestions: Get Next/Previous suggestion
When using zsh-autosuggestions, is it possible to see more than one suggestion by rolling to the next/previous suggestion? i.e. if I type:
ls
I might get ls -l as a suggestion - is there a keyboard ...
0
votes
0
answers
39
views
How do I tell Mac Terminal which of two Zero/0 characters to use?
My question arises from my Mac Terminal's response to commands like cal and date. I use ZSH and UTF-8.
As you know, most monospace fonts, including Apple's own SF Mono, offer at least two choices for ...
1
vote
1
answer
29
views
DTerm (macOS one-stroke quick terminal) > Issues with $PATH in ZSH
I’ve been using DTerm for a long time as a fast and convenient way to get to a “path aware” terminal prompt in macOS - but since upgrading to BigSur/ZSH, the $PATH in DTerm and Terminal.app/iTerm ...
0
votes
0
answers
59
views
How to change the font color in the title of iTerm 2?
Does anyone know what option should I put in .zshrc to change the font color in the title of iTerm from grey to white? I spent 24h and still couldn't find the right option because there are a lot of ...
2
votes
1
answer
34
views
Having your shell commands run after consecutive ssh
I have a function in my zsh source file ~/.zshrc:
function cr() {
ssh -p 5022 myname@ssh.mylaboratory.fr
ssh servername2
screen -ls
}
However, everything after the first ssh seems to be ...
0
votes
0
answers
40
views
Zsh: Passing multiple arguments to command (ls) from a variable ($LS_OPTIONS)
I am trying to customize ls command adding arguments to $LS_OPTIONS
The ls alias and LS_OPTIONS are defined in the default config file:
export LS_OPTIONS='--color=auto'
...
alias ls='ls $LS_OPTIONS'
...
1
vote
0
answers
79
views
compgen on zsh returns a different result than on bash
I am trying to make bash completions work properly in zsh.
I am aware of the need to load these in ~/.zshrc:
autoload -Uz +X compinit && compinit
autoload -Uz +X bashcompinit && ...
1
vote
1
answer
32
views
Pressing Tab Key in Terminal Enters a Space Instead of Triggering Autocomplete
First time asking on this site, please let me know if I can improve the question :)
I'm helping a student configure her mac development environment.
We've got zsh setup, which I believe should come ...
0
votes
1
answer
36
views
How to write a bash function that calls a command with the same name?
I want to write a wrapper around a command that checks a condition before executing the underlying command. I can't figure out how to execute the underlying command without invoking the current ...
1
vote
1
answer
30
views
/usr/bin/MAKE simultaneously present and not present
I'm using macOS Monterey 12.0.1. When I run the Terminal app, it informs me "The default interactive shell is now zsh." Okay.
Today I ran make to build a program, except my caps lock was on ...
0
votes
1
answer
51
views
How to refresh terminal after function call
I've written a simple function to search the current folder when I press ctrl+f with exa and peco, after I choose a directory I want to cd into it.
(ll is modified version of ls)
pecofunc() {
ll | ...
0
votes
0
answers
25
views
How to implement zsh directory entry and exit hooks?
I want to implement a function, when I enter a directory through cd, it will automatically scan whether the alias.sh file exists in the directory.
If the file exists, source it to load it. alias.sh is ...
0
votes
0
answers
22
views
How to get windows terminal to open Ubuntu at correct location?
I have windows 11. I installed Ubuntu 20 LTS and have it running as a nested environment. When I click the Ubuntu app it opens a new terminal (on Windows Terminal) at the Linux location home/<user-...
0
votes
1
answer
19
views
Using git completion inside function
I use ZSH and have git completions working, provided by brew install git (installed to /opt/homebrew/share/zsh/site-functions).
If I git commit [TAB], it will autocomplete paths which have been ...
0
votes
0
answers
18
views
quote mark (U+0027) in perl substitution
I need to put two spaces between sentences in a large number of text files.
A sentence ending is defined as period, exclamation, or question, maybe a close-quote, and then a space. Tabs and line ...
0
votes
0
answers
17
views
Terminal constantly changing shell – slower response
So I did a format of my mac, new install (Mac OS 12.1). Since then my terminal (2.12) has been switching shells without any command. My default shell is zsh. Basically for some reason every time I run ...
0
votes
0
answers
60
views
How can I create a FAT32 disk with 'newfs_msdos'?
I'm using terminal on a mac.
I tried to create a FAT32 disk with 'newfs_msdos', but I got the following error and cannot create it.
I was able to create a FAT32 disk by running the command 'diskutil ...
0
votes
2
answers
80
views
zsh: keep all command outputs on terminal screen
I'd like to know how can I get zsh to behave like bash regarding this:
I want command outputs to always show up right below these commands in terminal.
For example, when I run the following command ...
0
votes
0
answers
51
views
How can I redirect the output of a command that only writes to a file, not stdio?
There’s a command I want to run that writes to a specified file. Is it possible to redirect the output of this command to the stdin of another command?
The command looks like this:
foo -o filename
I’...
0
votes
1
answer
31
views
zsh auto-complete 'tab' auto-capitalization - need fix
All - Recently I have seen the 'zsh' on Mac OS Monterey 12.1 is auto-capitalizing commands on pressing the tab (auto-completion) which is irritating + causing issues now & then while I am ...
0
votes
1
answer
89
views
Antigen failing to load theme from .zshrc
I have a fresh Debin Bullseye installation and I can't get antigen to load a theme if loading it directly in .zshrc.
I installed zsh and zsh-antigen using apt.
My minimal .zshrc:
source /usr/share/zsh-...
0
votes
0
answers
32
views
How to save the terminal history to multiple files in different formats?
I use Oh My ZSH as default shell on my Ubuntu 20.04 (actually WSL2 on Windows). It stores history entries in another format than the standard bash. I'd like to store history entries to two files:
to ...
0
votes
0
answers
29
views
How to fix right click/copy-paste issue on terminal?
I can't right click or copy paste on on terminal from time to time. If I close the tab and open a new tab, it works fine temporarily, but it gives the same issues after a while. I'm usin oh my zsh. ...
3
votes
1
answer
61
views
Setting up a new mac to avoid "system" folders like Documents, Music, Desktop, etc
As a computational scientist, I spend a lot of time working on my macbook pro at the command line. I'm setting up a new laptop and it's time to rethink some of my setup.
It's always bothered me that ...
1
vote
0
answers
42
views
Terminal (zsh) prompt not showing up
I am using zsh on my Macbook, but sometimes out of nowhere the terminal prompt just doesn't show up when I launch it, and only restarting the computer fixes that. Any ideas about what could be causing ...
0
votes
0
answers
22
views
Tmux change cli command output to violet color instead of white
As you can see in the screenshot, what is outputted in white in zsh is outputted in violet/purple in tmux. I have tried enabling true color support for tmux and as you can see it work. Tmux shell ...
0
votes
0
answers
26
views
How to make fzf respect `FZF_DEFAULT_COMMAND` when using it through `FZF_COMPLETION_TRIGGER`?
As stated in the README, fzf only honors FZF_DEFAULT_COMMAND when invoked directly, and there is a separate setting FZF_CTRL_T_COMMAND. However, when I type a file pattern followed by a completion ...
0
votes
0
answers
73
views
Tmux on start and with previous command
I can easily start tmux on my shell on start, but let's assume:
Process A => launch a new terminal (process B) with a command
Process B => just start tmux without launching the command passed ...
0
votes
0
answers
140
views
Remove a zsh plugin which enables this
I have configured my zsh konsole and it looks like this when kde terminal is started
[WARNING]: Console output during zsh initialization detected.
When using Powerlevel10k with instant prompt, ...
1
vote
1
answer
26
views
Create Files with Different Character Encodings from Z-Shell
I'm trying to understand character encoding better. To experiment, I want to take a string of characters and encode in different ways. Does zsh prompt have a way to create files that use specific ...
1
vote
1
answer
157
views
Filter stdin of process executed with socat client
My question is: is there a way to pre-process the stdin of a command executed via socat client.
Context:
I am launching a reverse shell with socat using this command:
$> socat -T30 "openssl-...
0
votes
0
answers
26
views
How can I automatically run some sudo terminal commands when a VPN connection is established on macOS?
I would like to be able to run two terminal commands as soon as a VPN connection is established. I'm using the macOS built in VPN client to connect to an IKEv2 VPN server.
These are the commands I'd ...
0
votes
0
answers
22
views
Reloading .tmux.conf via shell script fails to complete
In MacOS, I have a shell script that makes some changes to my tmux config file, then reloads it (by running tmux source-file). Usually, it completes successfully, but sometimes (I estimate about 5%) ...
0
votes
0
answers
35
views
Why the shell of MSYS2 can find binary files without "exe" extension in the folder /usr/bin
In MSYS2, for the binary files in the folder /usr/bin, I find that I can call them by "name" or "name.exe". However, in the Windows file system, there are only binary files with &...
0
votes
1
answer
89
views
ZSH iterate through string array containing spaces
I am trying to write a ZSH script which will iterate through a series of strings that contain spaces.
First, I'll set -A the array:
set -A a "this is" "a test" "of the" &...