Use flag to get buffer history size

This commit is contained in:
Bruno Sutic 2015-03-18 16:22:35 +01:00
parent 2625de7c2e
commit 08fa1b52c4
No known key found for this signature in database
GPG key ID: 66D96E4F2F7EF26C
2 changed files with 4 additions and 2 deletions

View file

@ -3,6 +3,8 @@
### master
- `capture-pane` gets a `-J` flag. It joins wrapped lines and preserves trailing
spaces at each line's end.
- when capturing whole history, do not guess its size, but get it from
`#{history_limit}` format flag
### v2.0.0, 2015-03-14
- update readme

View file

@ -18,8 +18,8 @@ capture_pane() {
local file="$(get_path)/$(get_filename)"
local capture_scope=$1
if [ $capture_scope == "History" ]; then
# copying 9M lines back will hopefully fetch the whole scrollback
tmux capture-pane -J -S -9000000 -p > "$file"
local history_limit="$(tmux display-message -p -F "#{history_limit}")"
tmux capture-pane -J -S "-${history_limit}" -p > "$file"
elif [[ $capture_scope == "Screen capture" ]]; then
tmux capture-pane -J -p > "$file"
else