LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-21-2012, 08:36 AM   #1
jorants
LQ Newbie
 
Registered: Nov 2012
Posts: 6

Rep: Reputation: Disabled
"recording" xterm


Hello everyone,

I'm trying to save (and than send but that is not importand) everything that i see in my xterm window.
the goal is to do this in real time, so every time i type something or output is produced the information is updated.
the best thing would be to to get a file that contains all the characters and basically opening it in a texteditor would show the last state.

I tryed screen with both log and hardcopy.
hardcopy got me the desired result but only wrtes the file once and doesn't keep updating.
log keeps updating but it fails like hell as soon as i start a ncurses program like vim of nano.

i'm trying to find kind of a comination of the two.

tanx in advance,

Joran
 
Old 11-21-2012, 09:27 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by jorants View Post
I tryed screen with both log and hardcopy.
What are these "log" and "hardcopy"?


Quote:
Originally Posted by jorants View Post
hardcopy got me the desired result but only wrtes the file once and doesn't keep updating.
log keeps updating but it fails like hell as soon as i start a ncurses program like vim of nano.
Escape sequences used for positioning and colors will fsck up output no matter what. The only solution providing an accurate representation would involve screen recording but then you obviously loose text extraction capability. As for "log" failing, have you tried massaging the output? I would recommend using 'rootsh' but even its log isn't free from escape sequences but with
Code:
cat file|perl -pe 's/\e([^\[\]]|\[.*?[a-zA-Z]|\].*?\a)//g'|col -bx
here's for example output from running 'system-config-network-tui' (a ncurses app) inside a screen session:
Code:
┤ Network Configuration ├┐
│                         │
│    Loading Device       │
│    Configuration        │
│                         │
└─────────────────────────┘
                           <Tab>/<Alt-Tab> between elements   |  <Space> selects   |  <F12> next screenHardware
                Profile





                          ┌──────┤ Select Action ├──────┐
│                             │
│   Edit Devices              │
│   Edit DNS configuration    │
│                             │
│                             │
│                             │
│  ┌───────────┐   ┌──────┐   │
│  │ Save&Quit │   │ Quit │   │
│  └───────────┘   └──────┘   │
│                             │
│                             │
└─────────────────────────────┘
Devices           Save&Quit  Save&Quit  Quit
 ┌──────┐
 │ Quit │
└──────┌──────┐
│ Quit │
└──────┘

Last edited by unSpawn; 11-21-2012 at 09:28 AM. Reason: //More *is* more
 
Old 11-21-2012, 10:20 AM   #3
jorants
LQ Newbie
 
Registered: Nov 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
Tanx, i will take a look at it.

and about log and hardcopy: C-a h in screen for hardcopy and c-a H voor log.
Log just copys all output to a file and keeps doing so, hardcopy copys te current screen.
it would be nice to hardcopy every 0.1 seconde or so.
 
Old 11-21-2012, 10:25 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Thanks, now I know why the terms did sound familiar...
 
Old 11-21-2012, 10:50 PM   #5
dru8274
Member
 
Registered: Oct 2011
Location: New Zealand
Distribution: Debian
Posts: 105

Rep: Reputation: 37
You can use the script command to record an xterm session. That said, an ncurses program will fill the typescript file with unreadable escape chars. But if you tell script to save both a typescript file and a timing file, then your xterm session can be replayed perfectly with scriptreplay. True, even if you have been using ncurses etc.

Not an exact fit to your original question, but close enough for me to mention.
Code:
$ script -f -t transcript.log 2>timing.log

# Do some work here, ncurses etc if you like...
$ exit

# To replay the session...
$ scriptreplay timing.log transcript.log
Happy with ur solution... then tick "yes" and mark as Solved!

Last edited by dru8274; 11-21-2012 at 11:40 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
xterm: cannot match normal font "Monospace" on xterm 282, X11R7.7 ebol4 Linux - Software 2 10-07-2012 08:59 PM
How to set the font-size for "xterm" terminal-emulator (running "bash" shell) ajaygarg Linux - Desktop 1 03-09-2012 12:38 PM
"xterm -e ls" and then I want that the xterm window wait cstrieder Linux - General 4 01-22-2010 02:39 PM
Error opening terminal: xterm Terminal type "xterm" unknown Pscylo Slackware 10 04-17-2009 06:33 AM
DVD Writing "dvdrecord: Drive does not support TAO recording." ALInux Linux - Software 7 04-05-2007 06:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration