Skip to content

Commit 0588aee

Browse files
committed
Add Reset An Option Back To Its Default Value as a tmux til
1 parent a3d9106 commit 0588aee

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pairing with smart people at Hashrocket.
1010

1111
For a steady stream of TILs, [sign up for my newsletter](https://tinyletter.com/jbranchaud).
1212

13-
_983 TILs and counting..._
13+
_984 TILs and counting..._
1414

1515
---
1616

@@ -883,6 +883,7 @@ _983 TILs and counting..._
883883
- [Pane Killer](tmux/pane-killer.md)
884884
- [Reclaiming The Entire Window](tmux/reclaiming-the-entire-window.md)
885885
- [Rename The Current Session](tmux/rename-the-current-session.md)
886+
- [Reset An Option Back To Its Default Value](tmux/reset-an-option-back-to-its-default-value.md)
886887
- [Show The Current Value For An Option](tmux/show-the-current-value-for-an-option.md)
887888
- [Swap Split Panes](tmux/swap-split-panes.md)
888889
- [Switch To A Specific Session And Window](tmux/switch-to-a-specific-session-and-window.md)
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Reset An Option Back To Its Default Value
2+
3+
Once you start changing the values of options, tmux can be opaque about what
4+
the original default values were.
5+
6+
For instance, if you change the `escape-time` option with the following
7+
command:
8+
9+
```bash
10+
$ tmux set-option -g escape-time 0
11+
```
12+
13+
It's now set to `0`, so without digging through the tmux man pages, how do you
14+
figure out what the default was and restore it?
15+
16+
The `set-option` command takes the `-u` flag to _unset_ the option. This will
17+
restore it to the default.
18+
19+
```bash
20+
$ tmux set-option -u escape-time
21+
```
22+
23+
And you can now see the original default value with `show-option`.
24+
25+
```bash
26+
$ tmux show-option escape-time
27+
500
28+
```
29+
30+
Use `set-option -u` with any option to restore it to its default.
31+
32+
Find `set-option` in `man tmux` for more details.

0 commit comments

Comments
 (0)