screen-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

printcmd falls back to LIT (display) after 512 bytes of print output


From: Caylan Larson
Subject: printcmd falls back to LIT (display) after 512 bytes of print output
Date: Wed, 28 Nov 2012 15:18:44 -0600

Hi,

I suspect printcmd is failing silently and never creating a pipe or forking a process.

When I set:

  printcmd "cat > /tmp/screen.print"

and print this sample output:

^[[1;9H.R^[[24;1H^[[0K>Printing Receipt for the LAST Sale^[[5i^M
^[!)Super Test Market^[!^A^M
^M
            XXXXXXXXXXXXXXX^M
            YYYYYYYYYYYY^M
            ZZZZZZZZZZ^M
            AAAAAAAABBBBBBBBB^M
^M
Wed Nov 28, 2012 at 11:34 AM  #: 9  0^M
^M
^M
^[! DELI:^[!^A^M
FIVE CHEESE PIZZA       1        $7.99  T L^M
^M
SUBTOTAL   :                     $7.99^M
TAXABLE    : $7.99        TAX:   $0.56^M
TOTAL DUE  :        ^[!)    $8.55^[!^A^M
^M
Item Count : 1^M
^M
Sale#: 3^M
^M
Cash : $8.55^M
^[!)$7.99^[!^A  (100%) of the Items purchased^M
came from LOCAL sources.^[! ^M
^M
Order Everything But the Turkey from our^M
deli & relax this Thanksgiving.^[!^A^M
^M
            T H A N K   Y O U^M
^M
^M
^M
^M
^M
^M
^M
^M
^[m^[[4i^[[24;1H^[[0K^[[1;9H                          ^[[1;9H

The display reads:

Printing Receipt for the LAST Sale
ey from our
deli & relax this Thanksgiving.

The output "ey from our" is right around the 512 byte marker for the print input.  In other words, starting at ^[[5i and ending at ^[[4i equals approximately 512 bytes.

From looking at the source I see that MAXSTR is 512 bytes and PrintFlush() is called.

PrintFlush()
{
  display = curr->w_pdisplay;
  if (display && printcmd)
    {
      char *bp = curr->w_string;
      int len = curr->w_stringp - curr->w_string;
      int r;
      while (len && display->d_printfd >= 0)
        {
          r = write(display->d_printfd, bp, len);
          if (r <= 0)
            {
              WMsg(curr, errno, "printing aborted");
              close(display->d_printfd);
              display->d_printfd = -1;
              break;
            }

          bp += r;
          len -= r;
        }
    }
…..

My limited knowledge of C leads me to WMsg and LMsg, which should be displayed on the caption.  However, nothing is displayed indicating failure or success.  I've tried logging and verbose mode.  I'm not sure why the printcmd is failing.  What else can I check?

Thank you!

Caylan


reply via email to

[Prev in Thread] Current Thread [Next in Thread]