How to dump content of cmd shell buffer
am 02.01.2008 22:10:25 von Harry PutnamHow can I dump the contents of my command shell buffer to a file,
using recent bash?
I googled up an exmple using zsh but I don't really want to use zsh
How can I dump the contents of my command shell buffer to a file,
using recent bash?
I googled up an exmple using zsh but I don't really want to use zsh
Harry Putnam wrote:
> How can I dump the contents of my command shell buffer to a file,
> using recent bash?
You mean the shell's command history?
Try 'history' or 'fc -l' (with appropriate arguments to view more than
the default) and redirect the output.
Janis
>
> I googled up an exmple using zsh but I don't really want to use zsh
Harry Putnam wrote:
> How can I dump the contents of my command shell buffer to a file,
> using recent bash?
history > filename
--
Best regards | Be nice to America or they'll bring democracy to
Cyrus | your country.
On Wed, 02 Jan 2008 22:16:29 +0100, Janis Papanagnou
>Harry Putnam wrote:
>> How can I dump the contents of my command shell buffer to a file,
>> using recent bash?
>
>You mean the shell's command history?
Yikes no... I must have been unclear
I want to dump the contents of a command shell buffer.
The stuff that accrues in your shell buffer as you work.
I keep a large number of lines in the buffer and every once in a while
I want something from way up there that has long ago scrolled off the
screen but is still withing the line limit of my fuffer.
Harry Putnam scrisse:
> How can I dump the contents of my command shell buffer to a file,
> using recent bash?
I think script can be useful
man script
On 1/2/2008 3:29 PM, Harry Putnam wrote:
> On Wed, 02 Jan 2008 22:16:29 +0100, Janis Papanagnou
>
>
>
>>Harry Putnam wrote:
>>
>>>How can I dump the contents of my command shell buffer to a file,
>>>using recent bash?
>>
>>You mean the shell's command history?
>
>
> Yikes no... I must have been unclear
>
> I want to dump the contents of a command shell buffer.
>
> The stuff that accrues in your shell buffer as you work.
That still sounds like your shell's command history. Can you give us any more
information on this "buffer" (e.g. where it's documented or variables/commands
through which you control/access it)?
> I keep a large number of lines in the buffer and every once in a while
> I want something from way up there that has long ago scrolled off the
> screen but is still withing the line limit of my fuffer.
It's still not clear what you're looking for, but it sounds like maybe you want
to see some text that was displayed on your screen but has now disappeared off
the top of the window it was displayed in. If so, you need to look at the
documentation for whatever windowing system you're using rather than your shell.
For example, if you're using xterms, scrollbars can be enabled with the
appropriate options when you start the xterm, or with the appropriate
control-button sequence while the xterm is already running.
Ed.
Harry Putnam wrote:
> On Wed, 02 Jan 2008 22:16:29 +0100, Janis Papanagnou
>
>
>
>>Harry Putnam wrote:
>>
>>>How can I dump the contents of my command shell buffer to a file,
>>>using recent bash?
>>
>>You mean the shell's command history?
>
>
> Yikes no... I must have been unclear
>
> I want to dump the contents of a command shell buffer.
I've never heared of a "command shell buffer", besides the command line
history.
>
> The stuff that accrues in your shell buffer as you work.
>
> I keep a large number of lines in the buffer and every once in a while
> I want something from way up there that has long ago scrolled off the
> screen but is still withing the line limit of my fuffer.
Usually you have to take actions _in advance_ to get the contents of the
screen that is no longer visible. The various windowing systems support
different concepts; like specifying (visible and scrollable) buffer sizes
and enabling scroll buttons. If you want to log all output on shell level
you have to use a "wrapper" *before* you start logging; the 'screen'
command will do that.
Janis
On Wed, 02 Jan 2008 22:39:12 +0100, "mallin.shetland"
>Harry Putnam scrisse:
>
>> How can I dump the contents of my command shell buffer to a file,
>> using recent bash?
>
>I think script can be useful
usefull yes but not what I'm after. I don't want to have to monkey
around with control characters in the ouput. Or other nasties one
gets in a `typescript'. I guess those would probably occur by dumping
too though. But the worst is having to start and stop the script.
I mean, its not world shaking but just more baloney to mess around
with. To me it would be much handier to do:
dumpcmd|grep something
or
dumpcmd|tee file|grep something
Where I would quickly find what I wnated and have a full record of the
content.
For all who have responded:
The buffer is the area of an xterm (or console teminal) . The same
place one finds the command prompt... hence the term I used `command
shell buffer' The memory or content of the shell buffer where the
command prompt is.
Its documented well in man xterm and Thomas Dickie has written untold
numbers of anserers about the control switches here and in other
comp.unix groups.
The one that controls the number of lines saved `savedlines' is `-sl'
I've set it as high as 30,000 thousand for some tests once but
generally set it around 8,000
(Note: I'm not sure a console login offers a mechanism to change the
buffer or `lines saved' )
However when I do want something from in there it involves a lot of
scrolling and squinting. I've often thought how nice it would be to
be able to grep it. So if it were dumpted to a file I could do that
handily.
`script' can accomplish that but in a more round about way.
On Wed, 02 Jan 2008 23:33:09 +0100, Janis Papanagnou
[...]
>> Yikes no... I must have been unclear
>>
>> I want to dump the contents of a command shell buffer.
>
>I've never heared of a "command shell buffer", besides the command line
>history.
Well if its a shell it has to have a buffer right'
When you cd to a directory with lots of files and
say `ls'
That data scrolls up into the shells buffer.
I've posted another message here that should clear up what I'm talking
about... sorry for the confusion.
Harry Putnam wrote:
> On Wed, 02 Jan 2008 23:33:09 +0100, Janis Papanagnou
>
>
> [...]
>
>
>>>Yikes no... I must have been unclear
>>>
>>>I want to dump the contents of a command shell buffer.
>>
>>I've never heared of a "command shell buffer", besides the command line
>>history.
>
>
> Well if its a shell it has to have a buffer right'
No, that's wrong; if by buffer you do not mean the command buffer but
the output of invoked programs.
>
> When you cd to a directory with lots of files and
> say `ls'
>
> That data scrolls up into the shells buffer.
No. It's the windowing system that does some buffering, if you configure
the windowing system that way.
The shell does not memorize any of the data that any started program will
have printed. The shell (well, modern shells, at least) will store the
issued commands, though.
Janis
>
> I've posted another message here that should clear up what I'm talking
> about... sorry for the confusion.
Harry Putnam wrote:
> On Wed, 02 Jan 2008 22:39:12 +0100, "mallin.shetland"
>
>
>
>>Harry Putnam scrisse:
>>
>>
>>>How can I dump the contents of my command shell buffer to a file,
>>>using recent bash?
>>
>>I think script can be useful
>
>
> usefull yes but not what I'm after. I don't want to have to monkey
> around with control characters in the ouput. Or other nasties one
> gets in a `typescript'. I guess those would probably occur by dumping
> too though. But the worst is having to start and stop the script.
>
> I mean, its not world shaking but just more baloney to mess around
> with. To me it would be much handier to do:
>
> dumpcmd|grep something
> or
> dumpcmd|tee file|grep something
>
> Where I would quickly find what I wnated and have a full record of the
> content.
>
> For all who have responded:
>
> The buffer is the area of an xterm (or console teminal) .
Right, the xterm (for example), not the shell.
> The same
> place one finds the command prompt... hence the term I used `command
> shell buffer' The memory or content of the shell buffer where the
> command prompt is.
If it's not script(1) then you may, maybe, find the command xcb(1)
helpful ('man xcb' for details).
Janis
>
> Its documented well in man xterm and Thomas Dickie has written untold
> numbers of anserers about the control switches here and in other
> comp.unix groups.
>
> The one that controls the number of lines saved `savedlines' is `-sl'
>
> I've set it as high as 30,000 thousand for some tests once but
> generally set it around 8,000
>
> (Note: I'm not sure a console login offers a mechanism to change the
> buffer or `lines saved' )
>
> However when I do want something from in there it involves a lot of
> scrolling and squinting. I've often thought how nice it would be to
> be able to grep it. So if it were dumpted to a file I could do that
> handily.
>
> `script' can accomplish that but in a more round about way.
On Thu, 03 Jan 2008 01:09:49 +0100, Janis Papanagnou
>> When you cd to a directory with lots of files and
>> say `ls'
>>
>> That data scrolls up into the shells buffer.
>
>No. It's the windowing system that does some buffering, if you configure
>the windowing system that way.
>
>The shell does not memorize any of the data that any started program will
>have printed. The shell (well, modern shells, at least) will store the
>issued commands, though.
Looks like I'm using the wrong terminology and had a foggy idea of how
it all worked but at least we know now what I'm speaking of.
Thainks
On Thu, 03 Jan 2008 01:12:41 +0100, Janis Papanagnou
>> The buffer is the area of an xterm (or console teminal) .
>
>Right, the xterm (for example), not the shell.
>
>> The same
>> place one finds the command prompt... hence the term I used `command
>> shell buffer' The memory or content of the shell buffer where the
>> command prompt is.
>
>If it's not script(1) then you may, maybe, find the command xcb(1)
>helpful ('man xcb' for details).
Apparently not installed here but dredging up a man page with google
it does look very interesting. I haven't studied it well yet but it
appears to talk alot about cut and paste... and cut bufffers.
So I guess you would scroll up your terminal window 8000 lines or
whatever it is and select it then put it somewhere?
It isn't real clear just what the heck it does do. I'll have to
install it and try it out.... thanks for that tip.
If its something better than scrolling up selecting and pasting etc.
that will solve most of my needs. However I do spend enough time
in console terminals that It would be nice to have access to that
`buffer' to.
Do you know if there is anyway other than typescript to get at that
buffer or what ever its called. (The scrolled up stuff), when in a
console terminal?
In article <477C0E59.2060804@lsupcaemnt.com>,
Ed Morton
> On 1/2/2008 3:29 PM, Harry Putnam wrote:
> > I keep a large number of lines in the buffer and every once in a while
> > I want something from way up there that has long ago scrolled off the
> > screen but is still withing the line limit of my fuffer.
>
> It's still not clear what you're looking for, but it sounds like maybe you
> want
> to see some text that was displayed on your screen but has now disappeared
> off
> the top of the window it was displayed in. If so, you need to look at the
> documentation for whatever windowing system you're using rather than your
> shell.
> For example, if you're using xterms, scrollbars can be enabled with the
> appropriate options when you start the xterm, or with the appropriate
> control-button sequence while the xterm is already running.
It sounds like he's already done that part, since he's able to scroll
back to the stuff he wants. He just wants to know how to get xterm to
dump its scroll buffer to a file.
It looks to me like xterm doesn't have a way to do this, so you would
have to use cut-and-paste from the terminal window to a text editor.
Apple's OS X Terminal app has File->Save in the menu.
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
Harry Putnam
> How can I dump the contents of my command shell buffer to a file,
> using recent bash?
If I understand your question...
1) using the scrollbar in the terminal, copy and paste the text into
another window.
However, if you have a lot of output, the buffer might
overflow. Some terminals allow you to specify the buffer size.
2) start the program "script" (see the man page)
Do your interactive session.
type Control-D
The results will be stored in a file called 'typescript.'
However - it contains all input and output including commands
during the vi session, etc. You may have to edit it to remove
carriage returns, vi commands, etc.
2) start emacs. Let me try to give you a short intro if you don't know it.
Type "
and this will start up a shell session inside of emacs. Type your commands.
The input and output are stored in one of emacs buffers.
If you need to edit a file, it would be eaiser to do it in another
window if you don't know emacs. Or you can be brave and read the
FAQ and built-in tutorial.
When done, type
filename. Type in the filename and hit return. Everything you
typed, and everything printed to the terminal will be stored in the
file.
Exit emacs by typing
Harry Putnam wrote:
> On Thu, 03 Jan 2008 01:12:41 +0100, Janis Papanagnou
>
>
>
>>>The buffer is the area of an xterm (or console teminal) .
>>
>>Right, the xterm (for example), not the shell.
>>
>>
>>>The same
>>>place one finds the command prompt... hence the term I used `command
>>>shell buffer' The memory or content of the shell buffer where the
>>>command prompt is.
>>
>>If it's not script(1) then you may, maybe, find the command xcb(1)
>>helpful ('man xcb' for details).
>
>
> Apparently not installed here but dredging up a man page with google
> it does look very interesting. I haven't studied it well yet but it
> appears to talk alot about cut and paste... and cut bufffers.
>
> So I guess you would scroll up your terminal window 8000 lines or
> whatever it is and select it then put it somewhere?
Here's an example; I selected the contents of the the screen I want
(on my system - it may be different on yours; click left to start of
area, click right on end of area), then typed the commands to display
the contents on standard output (which can be redirected to a file as
well)...
$ xcb -p 0
85c85
< var newfileref = oldfileref.replace(/\.[^.]*$/, ext);
---
> var newfileref = oldfileref.replace(/\.[^.]*/, ext);
245c245
<
---
>
Or to process the files (with grep or whatever) further...
$ xcb -p 0 | grep ext
< var newfileref = oldfileref.replace(/\.[^.]*$/, ext);
> var newfileref = oldfileref.replace(/\.[^.]*/, ext);
Janis
>
> It isn't real clear just what the heck it does do. I'll have to
> install it and try it out.... thanks for that tip.
>
> If its something better than scrolling up selecting and pasting etc.
> that will solve most of my needs. However I do spend enough time
> in console terminals that It would be nice to have access to that
> `buffer' to.
>
> Do you know if there is anyway other than typescript to get at that
> buffer or what ever its called. (The scrolled up stuff), when in a
> console terminal?
On Wed, 02 Jan 2008 17:51:12 -0600, Harry Putnam wrote:
> On Wed, 02 Jan 2008 22:39:12 +0100, "mallin.shetland"
>
>
>>Harry Putnam scrisse:
>>
>>> How can I dump the contents of my command shell buffer to a file,
>>> using recent bash?
>>
>>I think script can be useful
>
> usefull yes but not what I'm after. I don't want to have to monkey
> around with control characters in the ouput. Or other nasties one
> gets in a `typescript'. I guess those would probably occur by dumping
> too though. But the worst is having to start and stop the script.
[...]
You may use GNU screen with its adjustable scrolling buffer in
which you can search. You can also log the output to a file
(though with the escape sequences). You can also do hardcopies
of the screen (without the escape sequences).
With xterm, you can also do some "print screen" and you can
customize the command that does the printing (replace lp/lpr
with a command that logs its input into a file for instance).
--
Stephane
Janis Papanagnou
> Harry Putnam wrote:
[...]
>> So I guess you would scroll up your terminal window 8000 lines or
>> whatever it is and select it then put it somewhere?
>
> Here's an example; I selected the contents of the the screen I want
> (on my system - it may be different on yours; click left to start of
> area, click right on end of area), then typed the commands to display
> the contents on standard output (which can be redirected to a file as
> well)...
[...]
Ok, thanks for the tutorial. It does have some advantages but the
killer is that you still have to mark off an area. If you have to do
that part then you aren't really saving much over just pasting the
selection somewhere and manipulating it from there.
What I was seeking to avoid was the marking out part mostly.
That means you have to go find what you want at least roughly,
manually. And that is what I don't want to have to do especially when
the material I'm after may be up to [678]000 lines away.
Some other posters have jogged my memory about the `screen' program.
And the horrible part is that I knew it had that capability and have
even used that very capability some time ago.
Old age is kicking my behind I guess.
Stephane Chazelas
> You may use GNU screen with its adjustable scrolling buffer in
> which you can search. You can also log the output to a file
> (though with the escape sequences). You can also do hardcopies
> of the screen (without the escape sequences).
Egad.. how right you are. And I have even used those very
capabilities. I probably shouldn't tell it but I was actually in
`screen' on the terminal that caused me to post the original message.
I had just forgotten all about that functionality. Thanks for jogging
my fading memory.
> With xterm, you can also do some "print screen" and you can
> customize the command that does the printing (replace lp/lpr
> with a command that logs its input into a file for instance).
Can you elaborate on this a bit? grepping the xterm man page on
`print' hasn't turned up anything related.
On Wed, 02 Jan 2008 18:58:27 -0600, Harry Putnam wrote:
> On Thu, 03 Jan 2008 01:09:49 +0100, Janis Papanagnou
>
>
>>> When you cd to a directory with lots of files and
>>> say `ls'
>>>
>>> That data scrolls up into the shells buffer.
>>
>>No. It's the windowing system that does some buffering, if you configure
>>the windowing system that way.
>>
>>The shell does not memorize any of the data that any started program will
>>have printed. The shell (well, modern shells, at least) will store the
>>issued commands, though.
>
> Looks like I'm using the wrong terminology and had a foggy idea of how
> it all worked but at least we know now what I'm speaking of.
>
> Thainks
So are you using xterm, a console, or what?
If in xterm you should be able to cut and paste with your mouse.
stonerfish
On Wed, 02 Jan 2008 17:51:12 -0600, Harry Putnam wrote:
> However when I do want something from in there it involves a lot of
> scrolling and squinting. I've often thought how nice it would be to
> be able to grep it. So if it were dumpted to a file I could do that
> handily.
>
> `script' can accomplish that but in a more round about way.
Notice: This may not work if your buffer is too big.
Ok got it you are using xterm.
1. Point your mouse after the last on the xterm and do a single click.
Don't wory if you see no effect from this click.
2. Move you mouse to the scoll bar and scroll to the top of the window.
3. Hold down shift and click before the first word. All the text
should become highlighted.
4. Now click your right mouse button and select copy.
5. Open your favorite text editor, and in it right click and choose paste.
stonerfish
On Wed, 02 Jan 2008 15:10:25 -0600, Harry Putnam wrote:
> How can I dump the contents of my command shell buffer to a file,
> using recent bash?
>
> I googled up an exmple using zsh but I don't really want to use zsh
Ok, I looked at the xterm man page.
The xterm mainMenu pops up when the ââcontrolââ key and pointer
button one are pressed in a window. This menu contains items that
apply to both the VT102 and Tektronix windows.
Log to File (logging)
Captures text sent to the screen in a logfile, as in the
-l logging option.
Seems pretty simple. Does that work?
ps. Please forgive my multiple answers to your question. If one works
use it. If none, then just ignore me.
stonerfish
reader@newsguy.com wrote:
> Stephane Chazelas
>> With xterm, you can also do some "print screen" and you can
>> customize the command that does the printing (replace lp/lpr
>> with a command that logs its input into a file for instance).
> Can you elaborate on this a bit? grepping the xterm man page on
> `print' hasn't turned up anything related.
Possibly you're looking in an old manpage.
xterm supports ANSI color, VT220 emulation and UTF-8
There's an faq at
http://invisible-island.net/xterm/xterm.faq.html
ftp://invisible-island.net/xterm/
here are some related X resources (from xterm's manpage):
printAttributes (class PrintAttributes)
Specifies whether to print graphic attributes along
with the text. A real DEC VTxxx terminal will print
the underline, highlighting codes but your printer
may not handle these. A ``0'' disables the attri-
butes. A ``1'' prints the normal set of attributes
(bold, underline, inverse and blink) as VT100-style
control sequences. A ``2'' prints ANSI color attri-
butes as well. The default is ``1.''
printerAutoClose (class PrinterAutoClose)
If ``true'', xterm will close the printer (a pipe)
when the application switches the printer offline
with a Media Copy command. The default is
``false.''
printerCommand (class PrinterCommand)
Specifies a shell command to which xterm will open a
pipe when the first MC (Media Copy) command is ini-
tiated. The default is a blank string. If the
resource value is given as a blank string, the
printer is disabled.
printerControlMode (class PrinterControlMode)
Specifies the printer control mode. A ``1'' selects
autoprint mode, which causes xterm to print a line
from the screen when you move the cursor off that
line with a line feed, form feed or vertical tab
character, or an autowrap occurs. Autoprint mode is
overridden by printer controller mode (a ``2''),
which causes all of the output to be directed to the
printer. The default is ``0.''
printerExtent (class PrinterExtent)
Controls whether a print page function will print
the entire page (true), or only the the portion
within the scrolling margins (false). The default
is ``false.''
printerFormFeed (class PrinterFormFeed)
Controls whether a form feed is sent to the printer
at the end of a print page function. The default is
``false.''
--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
Thomas Dickey
> There's an faq at
> http://invisible-island.net/xterm/xterm.faq.html
Thanks... Nice to hear from you directly...
Something there I'm looking into.
It mentions a Ctrl-mouse popup with `print window'. On my setup that
is greyed out so I assumed it was a compile time option.
After downloading the most recent release source (230) and running
../configure --help |grep print
./configure --help|grep print
-q, --quiet, --silent do not print `checking...' messages
--disable-c1-print disallow -k8 option for printable 128-159
I'm wondering if it is a built in default and if so why mine would be
greyed out. From what you've posted and the man page it appears some
complicated cascading arrangement is required, and then its not at all
clear what the output would be.
My distribution uses the xterm sources from your page:
http://dickey.his.com/xterm/
Currently installed is 229.
That man page tells me that `Print Window' needs printerCommand resouces.
Leading right to the info you've posted:
printerCommand (class PrinterCommand)
Specifies a shell command to which xterm will open a pipe when the
first MC (Media Copy) command is initiated. The default is a blank
string. If the resource value is given as a blank string, the
printer is disabled.
But it is still not clear at all how all this really works.
Can one just set something to cause printing to be sent directly to a
file? It doesn't sound like it. Further it also sounds as if the
output would not be very usable anyway, unless you were a printer.
In laymans terms how does one use any of this to access the scroll
back buffer? Not to a printer or in some codified output but in some
format usable to common unix utilities like grep, sed, awk... etc.
Oh yes, and does `Print Window' really print only the visible window
or the full buffer?
On Thu, 03 Jan 2008 09:02:28 -0600, reader@newsguy.com wrote:
> Thomas Dickey
>
>> There's an faq at
>> http://invisible-island.net/xterm/xterm.faq.html
>
> Thanks... Nice to hear from you directly...
>
> Something there I'm looking into.
>
> It mentions a Ctrl-mouse popup with `print window'. On my setup that
> is greyed out so I assumed it was a compile time option.
[...]
Try:
xterm -xrm '*printerCommand: cat > /tmp/somefile' -xrm '*printAttributes: 0'
--
Stephane
On 03 Jan 2008 15:50:38 GMT, Stephane Chazelas wrote:
> On Thu, 03 Jan 2008 09:02:28 -0600, reader@newsguy.com wrote:
>> Thomas Dickey
>>
>>> There's an faq at
>>> http://invisible-island.net/xterm/xterm.faq.html
>>
>> Thanks... Nice to hear from you directly...
>>
>> Something there I'm looking into.
>>
>> It mentions a Ctrl-mouse popup with `print window'. On my setup that
>> is greyed out so I assumed it was a compile time option.
> [...]
>
> Try:
>
> xterm -xrm '*printerCommand: cat > /tmp/somefile' -xrm '*printAttributes: 0'
Note that if you want the scroll back buffer, "print window"
won't work, you'd need to send this escape sequence:
printf '\e[?11i'
--
Stephane
On Jan 3, 1:58 am, Harry Putnam
> On Thu, 03 Jan 2008 01:09:49 +0100, Janis Papanagnou
>
>
> >> When you cd to a directory with lots of files and
> >> say `ls'
>
> >> That data scrolls up into the shells buffer.
>
> >No. It's the windowing system that does some buffering, if you configure
> >the windowing system that way.
>
> >The shell does not memorize any of the data that any started program will
> >have printed. The shell (well, modern shells, at least) will store the
> >issued commands, though.
>
> Looks like I'm using the wrong terminology and had a foggy idea of how
> it all worked but at least we know now what I'm speaking of.
>
> Thainks
bash | tee foo.log ?
example:
$ bash | tee foo.log
$ date # an example command
$ Thu Jan 3 19:13:31 CET 2008
$ ls # another
foo.log
$ grep Jan foo.log # look at the log file
Thu Jan 3 19:13:31 CET 2008
$ exit
Stephane Chazelas
> On Thu, 03 Jan 2008 09:02:28 -0600, reader@newsguy.com wrote:
>> Thomas Dickey
>>
>>> There's an faq at
>>> http://invisible-island.net/xterm/xterm.faq.html
>>
>> Thanks... Nice to hear from you directly...
>>
>> Something there I'm looking into.
>>
>> It mentions a Ctrl-mouse popup with `print window'. On my setup that
>> is greyed out so I assumed it was a compile time option.
> [...]
>
> Try:
>
> xterm -xrm '*printerCommand: cat > /tmp/somefile' -xrm '*printAttributes: 0'
Ok, I see how that works.
Thanks
Stephane Chazelas
> printf '\e[?11i'
Ahh nice... yes I'd noticed that scroll didn't work.
Good info, thanks posters.
Now does anyone know if some way to get at the scrollback buffer of a
console terminal (no X) is possible?
(aside from `screen' I mean)
The default TERM here in that scenario is `linux'
reader@newsguy.com wrote:
> It mentions a Ctrl-mouse popup with `print window'. On my setup that
> is greyed out so I assumed it was a compile time option.
no - "greyed out" (for xterm) means that it's not available because
the resources haven't been setup. In particular:
printerCommand (class PrinterCommand)
Specifies a shell command to which xterm will open a
pipe when the first MC (Media Copy) command is ini-
tiated. The default is a blank string. If the
resource value is given as a blank string, the
printer is disabled.
xterm expects that to be the name of a program - it'll open a pipe
to that program.
> Can one just set something to cause printing to be sent directly to a
> file? It doesn't sound like it. Further it also sounds as if the
> output would not be very usable anyway, unless you were a printer.
It's quasi-useful - comes out in a friendlier format than the logging
option. The printing feature in xterm is part of the emulation - makes
it almost like the original hardware terminal.
> In laymans terms how does one use any of this to access the scroll
> back buffer? Not to a printer or in some codified output but in some
> format usable to common unix utilities like grep, sed, awk... etc.
> Oh yes, and does `Print Window' really print only the visible window
> or the full buffer?
Just the visible window.
--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
Stephane Chazelas
> Note that if you want the scroll back buffer, "print window"
> won't work, you'd need to send this escape sequence:
> printf '\e[?11i'
in ctlseqs.txt, that's listed here:
CSI ? Pm i
Media Copy (MC, DEC-specific)
Ps = 1 -> Print line containing cursor
Ps = 4 -> Turn off autoprint mode
Ps = 5 -> Turn on autoprint mode
Ps = 1 0 -> Print composed display, ignores DECPEX
Ps = 1 1 -> Print all pages
--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
On Fri, 04 Jan 2008 00:04:01 -0000, Thomas Dickey wrote:
> Stephane Chazelas
>
>> Note that if you want the scroll back buffer, "print window"
>> won't work, you'd need to send this escape sequence:
>
>> printf '\e[?11i'
>
> in ctlseqs.txt, that's listed here:
>
> CSI ? Pm i
> Media Copy (MC, DEC-specific)
> Ps = 1 -> Print line containing cursor
> Ps = 4 -> Turn off autoprint mode
> Ps = 5 -> Turn on autoprint mode
> Ps = 1 0 -> Print composed display, ignores DECPEX
> Ps = 1 1 -> Print all pages
[...]
Hi Thomas,
BTW, I've been wondering whether it was possible to rebind menu
actions, or add entries to the menu. Then we could add a
interpret("\033[?11i") action entry.
Do you know if that's feasible?
--
Stephane
Stephane Chazelas
> Hi Thomas,
> BTW, I've been wondering whether it was possible to rebind menu
> actions, or add entries to the menu. Then we could add a
> interpret("\033[?11i") action entry.
> Do you know if that's feasible?
well, xterm doesn't do it now. Mostly when I've considered configurable
menus, it's been as making a list based on the Xt action data that
generally corresponds to the menus. The X resource mechanism isn't
very flexible regarding lists like that (so I've generally put the
idea aside again).
It's doable though...
--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
Looking back over this thread I didn't see any responses to the
question about doing some kind of dump from a text (console) terminal.
Anyone know if aside from the nifty screen program, there is any built
in way to do that?
reader@newsguy.com wrote:
> Looking back over this thread I didn't see any responses to the
> question about doing some kind of dump from a text (console) terminal.
> Anyone know if aside from the nifty screen program, there is any built
> in way to do that?
It depends on the type of system - generally not. I see that Linux
does, as documented in the console_ioctl manpage.
--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
reader@newsguy.com writes:
> Looking back over this thread I didn't see any responses to the
> question about doing some kind of dump from a text (console) terminal.
> Anyone know if aside from the nifty screen program, there is any built
> in way to do that?
Built into what? The terminal, or the shell?
I don't know of any shell that has this function.
So it needs to be in the terminal emulator.
As I said - emacs does this, even if the output is 600,000 lines long.
I use this feature quite often, and I prefer it for keeping a log of
long sessions. I don't have to worry about data being lost as the
trace grows. If I have to custom recompile large source programs. I
just recently customized mysql, apache, php on a server and I keep
notes of the changes, errors and warnings in emacs while I was
compiling and installing in emacs.
However, emacs is not good for running programs like top, or anything
that dynamically updates the display.
But emacs is a lifestyle choice. :-)
I'm using it to read this forum and post this response.
Maxwell Lol
> However, emacs is not good for running programs like top, or anything
> that dynamically updates the display.
>
> But emacs is a lifestyle choice. :-)
> I'm using it to read this forum and post this response.
hehe... thanks for your input including this. I am also an emacs user
for quite a few years now maybe 9 or so, but seems like I have some
kind of problem eventually using the shell tools.
Sooner or later color sequences or something bugger it up so I've
never really done a whole lot of shell use with it.
I also read news with an emacs tool (gnus)... a proud user since
quassia-19 or so... :).
There seems to be always some kind of problem using it for remote work
too. Unless you just use the ange_ftp stuff but with ssh using tramp
It seems like a lot of bother to get it working smoothly when I can
open a bash shell and get right at it.
Using the remote machines installed emacs can be a pain too. When you
get one with backspace and delete setup different. Sure you can fix
it but thats what I'm getting at.. too much fixing/fiddling.
Thomas Dickey
Harry wrote:
>> Looking back over this thread I didn't see any responses to the
>> question about doing some kind of dump from a text (console) terminal.
>> Anyone know if aside from the nifty screen program, there is any built
>> in way to do that?
Thomas answered:
> It depends on the type of system - generally not. I see that Linux
> does, as documented in the console_ioctl manpage.
Yikes, I thought I would have a look and learn about it but instead I
find 481 lines or really rough sledding... at least from my
perspective.
Can you provide a few clues.. Maybe a couple of search strings?
On Sat, 05 Jan 2008 16:55:11 -0600, reader@newsguy.com wrote:
> Looking back over this thread I didn't see any responses to the
> question about doing some kind of dump from a text (console) terminal.
> Anyone know if aside from the nifty screen program, there is any built
> in way to do that?
See /dev/vcs, /dev/vcs
a way to get the scroll-back buffer.
--
Stephane
reader@newsguy.com writes:
> Using the remote machines installed emacs can be a pain too. When you
> get one with backspace and delete setup different. Sure you can fix
> it but thats what I'm getting at.. too much fixing/fiddling.
Hmmm. On first thought that seems like a problem related to the shell
and unrelated to emacs.
Maxwell Lol
> reader@newsguy.com writes:
>
>> Using the remote machines installed emacs can be a pain too. When you
>> get one with backspace and delete setup different. Sure you can fix
>> it but thats what I'm getting at.. too much fixing/fiddling.
>
> Hmmm. On first thought that seems like a problem related to the shell
> and unrelated to emacs.
Yes, nearly always. But that is my point. Working on a number of remotes
you always run into stuff that makes emacs miss behave.
Also I've only scratched the surface of emacs, even in 9 yrs. I use
it for all editing where there aren't such problems.
reader@newsguy.com wrote:
> Thomas Dickey
> Harry wrote:
>>> Looking back over this thread I didn't see any responses to the
>>> question about doing some kind of dump from a text (console) terminal.
>>> Anyone know if aside from the nifty screen program, there is any built
>>> in way to do that?
> Thomas answered:
>> It depends on the type of system - generally not. I see that Linux
>> does, as documented in the console_ioctl manpage.
> Yikes, I thought I would have a look and learn about it but instead I
> find 481 lines or really rough sledding... at least from my
> perspective.
Stephane Chazelas gave that information. But here's what I saw:
"man console_ioctl" says
The action of the following ioctls depends on the first byte in the
struct pointed to by argp, referred to here as the subcode. These are
legal only for the superuser or the owner of the current tty.
TIOCLINUX, subcode=0
Dump the screen. Disappeared in 1.1.92. (With kernel 1.1.92 or
later, read from /dev/vcsN or /dev/vcsaN instead.)
and "man vcsa" gives an example of dumping the screen contents.
--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net