Mailinglist Archive: opensuse (1264 mails)

< Previous Next >
Re: [opensuse] tmux question
On 2017-06-09 03:55, Patrick Shanahan wrote:
* Carlos E. R. <robin.listas@xxxxxxxxxxxxxx> [06-08-17 20:20]:

In tmux it appears that I can not page up to see previous screen output.
Is it possible to go back somehow? Or even better, dump all the text
somewhere?

yes unless you have changed the configuration, the default keys are
<ctrl><b> <page-up/down>
will take you thru the screen buffer up/down

Oh! Indeed. A bit cumbersome, though.

Ah! Type once, then just pg-up/dn works. :-)


<ctrl><b> s
<ctrl><b> r
will search thru history

Or, is it possible to tell it to log all output to a file?

I don't do that but it is possible, even to select and save. see the fine
manual

Sigh. If they'd wrote them for dummies, easy to read...


-v Request verbose logging. This option may be specified
multiple times for increasing verbosity. Log messages will be saved into
tmux-client-PID.log and tmux-server-PID.log files in the current directory,
where PID is the PID of the server or client process.

Not usable now for an already running tmux session.

I don't see a keybinding for it.


This:

capture-pane [-aepPq] [-b buffer-name] [-E end-line] [-S start-line] [-t
target-pane]
(alias: capturep)
Capture the contents of a pane. If -p is given, the output goes
to stdout, otherwise to the buffer
specified with -b or a new buffer if omitted. If -a is given, the
alternate screen is used, and
the history is not accessible. If no alternate screen exists, an
error will be returned unless -q
is given. If -e is given, the output includes escape sequences
for text and background attributes.
-C also escapes non-printable characters as octal \xxx. -J joins
wrapped lines and preserves
trailing spaces at each line's end. -P captures only any output
that the pane has received that is
the beginning of an as-yet incomplete escape sequence.

-S and -E specify the starting and ending line numbers, zero is
the first line of the visible pane
and negative numbers are lines in the history. ‘-’ to -S is the
start of the history and to -E the
end of the visible pane. The default is to capture only the
visible contents of the pane.



I don't understand a word of it :-(

What I need is send the entire history of a session that is already running (it
has a crash dump of a program) to a file. I can not restart tmux now, it would
be lost.

The only way I now is page-dn, select with mouse, paste to another window,
repeat a hundred times :-(


If tmux were not running, I'd use menu-select-all, copy. Then paste on another
window, done, email.





Wild guess test.
cer@Telcontar:~> ssh -X cer@Isengard.valinor
Last login: Fri Jun 9 03:58:33 2017 from 192.168.1.14
Have a lot of fun...
cer@Isengard:~> tmux capture-pane -p > capture
cer@Isengard:~> l capture
-rw-r--r-- 1 cer users 1490 Jun 9 04:20 capture
cer@Isengard:~>

Well! It does capture the text, but only the visible part. I want all!

cer@Isengard:~> tmux capture-pane -p -S 1 -E 1200 > capture

Only visible lines. Not good. man says:

-S and -E specify the starting and ending line numbers, zero is
the first line of the visible pane
and negative numbers are lines in the history. ‘-’ to -S is the
start of the history and to -E the
end of the visible pane. The default is to capture only the
visible contents of the pane.

Got it!

cer@Isengard:~> tmux capture-pane -p -S- -E- > capture
cer@Isengard:~> l capture
-rw-r--r-- 1 cer users 65842 Jun 9 04:26 capture
cer@Isengard:~>
cer@Isengard:~> wc -l capture
1195 capture


Wow! Did it! :-)))



--
Cheers / Saludos,

Carlos E. R.
(from 42.2 x86_64 "Malachite" at Telcontar)

< Previous Next >