I was just preparing a presentation for GSE DACH and wanted to take a screen shot of my ROSCOE screen. Unfortunately it contained the name of the system I work on as well my user name and ROSCOE prefix.

None of these are allowed to make it to public presentation so I was looking for a way to edit the screen without having to take a screen shot and then paint it over.

Since I use the kitty terminal emulator and I have CMD+SHIFT+H mapped to show_scrollback action

kitty.conf:

map kitty_mod+shift+h show_scrollback

I can press CMD+SHIFT+H while in c3270 on my ROSCOE screen. This invokes less -R with the contents of the screen as standard input.

Now I can use the pipe command of less to pipe the contents to tee and save it to a file.

This is the sequence of the keys I had to press

|$tee /tmp/raw-screen.txt

This is it step by step:

  1. Press |, less prompts me with |mark:
  2. Press $, less responds with a prompt !
  3. Type tee /tmp/raw-screen.txt
  4. Press <ENTER>, less responds with |done (press RETURN)
  5. Press <ENTER>, less returns to the original screen with output
  6. Now open a separate terminal and vi /tmp/raw-screen.txt and edit the system name, user, name and other things that should not be shown
  7. Save
  8. Run less -R /tmp/raw-screen.txt and take a screenshot