Skip to content

Commit 08fa1b5

Browse files
author
Bruno Sutic
committed
Use flag to get buffer history size
1 parent 2625de7 commit 08fa1b5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
### master
44
- `capture-pane` gets a `-J` flag. It joins wrapped lines and preserves trailing
55
spaces at each line's end.
6+
- when capturing whole history, do not guess its size, but get it from
7+
`#{history_limit}` format flag
68

79
### v2.0.0, 2015-03-14
810
- update readme

scripts/capture_pane_helpers.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ capture_pane() {
1818
local file="$(get_path)/$(get_filename)"
1919
local capture_scope=$1
2020
if [ $capture_scope == "History" ]; then
21-
# copying 9M lines back will hopefully fetch the whole scrollback
22-
tmux capture-pane -J -S -9000000 -p > "$file"
21+
local history_limit="$(tmux display-message -p -F "#{history_limit}")"
22+
tmux capture-pane -J -S "-${history_limit}" -p > "$file"
2323
elif [[ $capture_scope == "Screen capture" ]]; then
2424
tmux capture-pane -J -p > "$file"
2525
else

0 commit comments

Comments
 (0)