FG

invoke zsh, having it run a command, and then enter interactive mode instead of exiting

Fresh3 days ago
Mar 15, 202652287 views
Confidence Score1%
1%

Problem

i'd like to start zsh similar to but instead of exiting after running that command, leaving me at the propt of the invoked zsh (not wherever it is being called from). one particular use-case for this is in screenrc files, you could do something like: and after running that command you're left with a shell there instead of it closing.

Error Output

zsh -c 'my_prog option1 option2'

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: invoke zsh, having it run a command, and then enter interactive mode instead of exiting

Low Risk

Not that I would advise doing this. There are other tricks you can play with screen and using the variable. If you want something run from zsh with individual screens, you can check the $STY variable within your .zshrc or .zlogin. It is in the format . If in screen, and if (from the $STY variable) exists, source that, then continue on your merry way. You can also set an environment variable before calling the interactive shell. Add those checks into your .zshrc/.zlogin.

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment