Ubuntu Notes screen chatGptAns: some useful configurations in .screenrc file like mouse support, ctrl+b instead of ctrl+a, etc?

 Certainly! The `.screenrc` file is a configuration file for `screen` that allows you to customize various aspects of its behavior. Here are some useful configurations that you might consider adding to your `~/.screenrc` file:

### 1. Enable Mouse Support:

```bash

# Enable mouse support

termcapinfo xterm* ti@:te@

```

This enables mouse support, allowing you to interact with `screen` using the mouse.

### 2. Change Escape Character to Ctrl-b:

```bash

# Change escape character to Ctrl-b

escape ^Bb

```

This changes the default escape character from `Ctrl-a` to `Ctrl-b`.

### 3. Set a Status Bar at the Bottom:

```bash

# Set a status bar at the bottom

hardstatus alwayslastline

hardstatus string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %C%a "

```

This sets up a status bar at the bottom of the screen, displaying information about windows and system status.

### 4. Adjust Status Line Colors:

```bash

# Adjust status line colors

shelltitle "$ |bash"

termcapinfo xterm* 'hs:ts=\E]0;:fs=\007:ds=\E]0;screen\007'

hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B}%Y-%m-%d %{W}%c %{g}]'

```

These lines adjust the colors of the status line, making it more visually appealing.

### 5. Set the Shell Title:

```bash

# Set the shell title

shelltitle "$ |bash"

```

This sets the title of the terminal window based on the current command being executed.

### 6. Enable UTF-8 Support:

```bash

# Enable UTF-8 support

defutf8 on

```

This enables UTF-8 support, which can be useful for working with international characters.

### 7. Adjust Scrolling Behavior:

```bash

# Adjust scrolling behavior

defscrollback 10000

```

This sets the scrollback buffer to 10,000 lines. Adjust the number to your preference.

### 8. Change Caption Line (Window List) Format:

```bash

# Change the caption line format

caption always "%{= kw}%-w%{= BW}%n %t%{-}%+w %=%{= kw}%y/%m/%d %C%A"

```

This changes the format of the caption line (window list) at the bottom of the screen.

Feel free to customize these configurations according to your preferences. Add or modify entries as needed, and remember to restart your `screen` session for changes to take effect.

No comments:

Post a Comment

If you have any doubts, please let me know.

Various types of salts effect on health (discussion with gemenie)

Is  rock salt or bitnoon helps in digestion or just a airuvedic nuska This is for informational purposes only. For medical advice or diagnos...