2004-09-09 : At work, I'm using SendSignal to generate Java stack dumps, and SaveConsole to save the dumps to a file. However, sometimes the console buffer is too small to capture the whole dump, in which case all I get is a truncated and heavily wrapped version which is rarely useful. Well, it certainly couldn't be any harder to resize the console than to save it to a file! So, I spent a few hours and wrote this tool.

I can think of a bunch of things that would make this tool more full-featured, but it is sufficient for my needs so I have resisted the temptaion to add more so far. For example, it would be nice to be able to control the window size; to be able to resize the buffer only if it was smaller that the desired size; control what portion of the buffer is kept when shrinking the buffer, etc.


ConsoleSize { <pid> | '-' } <width> <height>
  <pid> - save the console being used by process <pid> (hex ok)
  '-'   - save the current console
  <width> - new console width, 1-9999 (hex ok)
  <height> - new console height, 1-9999 (hex ok)

You can get the source via anonymous CVS at

  • cvs -d co 2004/ConsoleSize

    (Source and executable freely available under the LNHFS License.)

    Note: As with SaveConsole, this code only runs when compiled in debug mode because of the way it determines the length of the snippet to be injected.

    C o m m e n t s :    
    (nothing yet)