6,221 questions
0
votes
0
answers
15
views
iTerm2 opens tab with different profile than the default
I have a specific profile set as my default in iTerm2. For some weird reason, when I open a new tab using the Shell > New Tab menu item, iTerm2 opens the tab with the correct profile. I get the ...
0
votes
0
answers
28
views
local zsh history on up-arrow, global zsh-history on ctrl-R [closed]
I am looking for a very specific behavior in my Zsh terminals.
I have multiple terminal windows open at the same time.
On each terminal window, if I hit the up arrow, I'd like for it to go up through ...
-1
votes
0
answers
33
views
Extremely slow Terminal startup on macOS Sequoia (M3 Mac Pro) [closed]
Problem
On my new M3 Mac Pro (36 GB RAM) running macOS Sequoia 15.3.2, launching a new interactive shell in both the built‑in Terminal.app and the GPU‑accelerated Ghostty takes orders of magnitude ...
1
vote
2
answers
67
views
How to modify Terminal script that renames all items in folder, to rename all items in subfolder?
I have this basic Terminal script that iterates through a folder, finds the first instance of any "_" character, and renames the file using the text that occurs after that first underscore.
...
2
votes
1
answer
57
views
zsh completion with arguments that start with a colon
I'm trying to create a completion for a custom tool that has somewhat strange command/option syntax. It accepts several normal options with both single- and double dash, but also accepts arguments of ...
-5
votes
0
answers
186
views
How to correctly install and set up path configurations for python and pip?
I have multiple versions of python and pip installed. Using python3 in the terminal runs python 3.9.6, whereas pip runs python 3.12.9; so, I can use pip3 to install a package (for example, newtworkx), ...
2
votes
2
answers
65
views
Set zsh as default shell for Lando
I have installed zsh and oh-my-zsh in my Docker image that I use for Lando, but I can't seem to change the default shell upon entering it with lando ssh.
Oh-my-zsh is being installed with the CHSH=yes ...
0
votes
1
answer
55
views
How to completely detach a process when running a package.json script VSCode?
The problem
As part of automating away the tedious bits of React Native development I'm trying to run and detach the Android emulator as part of a package.json script when I start a development build ...
0
votes
1
answer
32
views
Specific new alias failing while existing works (even after restart)
During some cleanup on macOS Monterey, uninstalled and reinstalled gshuf. Aliased shuf to gshuf.
The line from zshrc:
alias shuf='gshuf'
I have a tool for my music with these three lines as the total ...
0
votes
1
answer
33
views
How can I make Zsh autocomplete in the middle of a word (like Bash)? [closed]
In Bash, when I press in the middle of a word, it suggests completions based on the text up to the cursor, and if I select one, it replaces the current word rather than appending to it or leaving any ...
1
vote
1
answer
49
views
Mix _arguments and _values in zsh autocomplete script
I have a command with a very structured input like
cmd --help
cmd A -flagA1 X
cmd A -flagA2 Y
cmd B -flagB1 Z
Where X,Y,Z are fixed values and depend on whether A or B is enabled.
Ideally, I'm trying ...
0
votes
2
answers
40
views
Is there a way to make new variables to be scoped locally by default in zsh?
Is there a way to make new variables to be scoped locally by default in zsh?
I was thinking something like this:
setopt magic_local_opt;
x=1
function foo {
x=2
}
echo $x
and then end goal would ...
1
vote
1
answer
69
views
zsh script command not finding ruby gem
I'm trying to write a simple .zsh script to start my webservers upon computer boot.
This works well:
#!/bin/zsh
cd /Users/me/Sites/Vue/mysite && npm run dev &
But this doesn't work:
#!/...
2
votes
3
answers
150
views
RANDOM is not random when used inside a function in bash
I am pretty new to bash scripting and I'm facing a behavior I can't explain.
I need to create random plate numbers, however the plate generated from the function I wrote always creates the same plate ...
1
vote
1
answer
80
views
.zshrc script on MacOS no longer prompts for input at Terminal startup, but it does when manually "sourced"?
For a long time, I've had a simple script in my .zshrc file on MacOS that will fetch some values from BitWarden (using the Bitwarden CLI) to set them as environment variables. For this, the script ...