Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tip for automatic screen startup in .zshrc #24

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,27 @@ If you have a _specific question_ about your last command, you can include a que
> wut "how do i add this to my PATH variable?"
```

### Automatic `screen` startup in `.zshrc`

To automatically start `screen` in a new terminal window using `.zshrc`, add the following code to your `.zshrc` file:

```zsh
if [[ -z $STY ]]; then
autoload -Uz add-zsh-hook
add-zsh-hook -U precmd () {
if [[ -z $STY ]]; then
screen
fi
}
fi
```

Additionally, add the following to your `~/.screenrc` file to disable the startup message:

```
startup_message off
```

## Roadmap

1. [If possible,](https://stackoverflow.com/questions/24283097/reusing-output-from-last-command-in-bash/75629157#75629157) drop the requirement of being inside a tmux or screen session.
Expand Down