6

is there an easy FOSS way to get a screenshot of a curses-based command line GUI when X isn't installed?

What if the powers-that-be say I can't remote login? (I'm working on it ha)

5

SSH to the server and run the curses-based command; it should translate properly to curses "graphics", depending on how your terminal client's emulation is configured. Screenshot using your desktop OS's utility.

At least, that's what I'd do.

| improve this answer | |
3

You can also use the screen program, and pressing ctrl-a h will write the screen to a file 'hardcopy.n'.

| improve this answer | |
2

scrot is a cli based screenshot tool which i've used before. Its a little quirky (it'll take a screenshot of the system i'm sshed in from) but might be ideal for your needs

| improve this answer | |
  • scrot works great, instantly, just scrot from xterm or M-! scrot in emacs. Only - it requires X to work. – Emanuel Berg Aug 29 '12 at 3:16
1

In addition to what Joe mentioned you can also use a virtual machine to get screen shots of things that you can't do any other way such as the installer.

If getting the output of a session including all commands and output command as text would be better then have a look at the script command. And in some situations something like pastebinit may be appropriate.

Although I'm not sure how script deals with a curses based app.

| improve this answer | |
1

If you're running on a virtual terminal (e.g. [Ctrl]-Alt-F1), you can, from another terminal, type:

sudo cat /dev/vcs1 > screenshot_file

or

sudo cat /dev/vcsa1 > screenshot_file

but the results probably won't be satisfactory.

| improve this answer | |
  • Why not, you just have to edit it somewhat! (This can be automatized.) A screenshot from a CLI application should be in text, that's so brilliant no wonder I didn't think of it. Best answer! – Emanuel Berg Aug 29 '12 at 2:51
  • Any idea how to automate the post-processing for /dev/vcsa1? For /dev/vcs1 something like `sudo cat /dev/vcs1|sed -E 's/.{240}/&\n/g' works for me (where 240 is the $COLUMNS of that terminal), but then color information is lost. – rubystallion Feb 26 at 19:52
0

I have done this on old serial terminals by takeing a photo of the termial screen. This is simple and works with no modifications to the terminal at all.

| improve this answer | |
  • yeah, this is a reasonable backup, i just need to fill out a few papers and wait a week for a photographer to come ;) – Dustin Getz Mar 24 '10 at 13:45
0

One solution might be a video loopback. In theory, you could use a Video4Linux device then capture its output with a v4l capture program.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.