Skip to content

Commit

Permalink
Add tip for automatic screen startup in .zshrc
Browse files Browse the repository at this point in the history
Related to shobrook#16

Add a tip for automatic `screen` startup in `.zshrc` to `README.md`.

* Add a new section under "Usage" for automatic `screen` startup in `.zshrc`.
* Include the suggested `.zshrc` configuration code snippet.
* Include the suggested `~/.screenrc` configuration code snippet to disable the startup message.
  • Loading branch information
vishwamartur committed Dec 21, 2024
1 parent af43093 commit 23834d1
Showing 1 changed file with 21 additions and 0 deletions.
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

0 comments on commit 23834d1

Please sign in to comment.