Joey Hess wrote:
> However, strace shows that when run by xfce4-terminal, w3m actually
> dumps the page to stdout and exits, same as if it were run in a pipe.

ssh -T has the desired properties:

    $ ssh -T blood test -t 0; echo $?
    1
    $ ssh -T blood test -t 1; echo $?
    1
    $ ssh -T blood test -t 2; echo $?
    1
    $ ssh -T blood tput longname; echo $?
    tput: No value for $TERM and no -T specified
    2

Thus it can be used to test the behaviour of tty browsers:

    $ ssh -T blood aptitude search --disable-columns "'-F%p %v'" ~i~Pwww-browser
    elinks 0.12~pre5-2ubuntu1
    links 2.2-1build1
    links2 2.2-1build1
    lynx-cur 2.8.8dev.2-1
    netrik 1.16.1-1
    w3m 0.5.2-2.1ubuntu1.1

Of all those, only netrik does what you seem to want -- exiting with a
non-zero exit status.  links and links2 don't even exit, despite there
/dev/tty being inaccessible and /dev/stdin being at EOF!

    $ ssh -T blood w3m http://example.net/ <&-; echo $?
    Homepage

      • Domains
      • Numbers
      • Protocols
      • About IANA

    Example Domains

    As described in RFC 2606, we maintain a number of domains such as 
EXAMPLE.COM
    and EXAMPLE.ORG for documentation purposes. These domains may be used as
    illustrative examples in documents without prior coordination with us. They 
are
    not available for registration.

                  Domains     Protocols     
    About         Root Zone                 [icann-logo]
    Presentations .INT        Number        IANA is operated by the
    Performance   .ARPA       Resources     Internet Corporation for Assigned 
Names
    Reports       IDN         Abuse         and Numbers
                  Repository  Information

    Please direct general feedback regarding IANA to i...@iana.org.

    0
    $ ssh -T blood lynx http://example.net/ <&-; echo $?


      Your Terminal type is unknown!

      Enter a terminal type: [vt100] 
    TERMINAL TYPE IS SET TO vt100
    HTTP request sent; waiting for response.

    [?1l>0
    $ ssh -T blood links http://example.net/ <&-; echo $?
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
              +------------------------ Welcome -------------------------+      
              |                                                          |      
              |                    Welcome to links!                     |      
              |                                                          |      
              |  To display menu, press ESC or click on the top line in  |      
              |  window. Select Help->Manual in menu for user's manual.  |      
              |                                                          |      
              |                          [ OK ]                          |      
              +----------------------------------------------------------+      
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
    Looking up host                                                             
   Making connectionRequest sent     Looking up hostMaking connectionRequest 
sent     IANA - Example domainsHomepage* Domains* Numbers* 
ProtocTransferringols* About IANAAs dEXAMmaybe uonwithAbouPresPerfrReports      
 .ARPAAbuse Information Assigned Names and NumbersIDN RepositoryPlease direct 
general feedback regarding IANA to i...@iana.org.http://www.iana.org/
      C-c C-c130
    $ ssh -T blood elinks http://example.net/ <&-; echo $?
       [1]Homepage

         * [2]Domains
         * [3]Numbers
         * [4]Protocols
         * [5]About IANA

                                    Example Domains

       As described in [6]RFC 2606, we maintain a number of domains such as
       EXAMPLE.COM and EXAMPLE.ORG for documentation purposes. These domains may
       be used as illustrative examples in documents without prior coordination
       with us. They are not available for registration.

                        [11]Domains    [16]Protocols
       [7]About         [12]Root Zone                 IANA is operated by the
       [8]Presentations [13].INT       [17]Number     [19]Internet Corporation
       [9]Performance   [14].ARPA      Resources      for Assigned Names and
       [10]Reports      [15]IDN        [18]Abuse      Numbers
                        Repository     Information

       Please direct general feedback regarding IANA to [20]i...@iana.org.

    References

       Visible links
       1. http://www.iana.org/
       2. http://www.iana.org/domains/
       3. http://www.iana.org/numbers/
       4. http://www.iana.org/protocols/
       5. http://www.iana.org/about/
       6. http://www.iana.org/go/rfc2606
       7. http://www.iana.org/about/
       8. http://www.iana.org/about/presentations/
       9. http://www.iana.org/about/performance/
      10. http://www.iana.org/reports/
      11. http://www.iana.org/domains/
      12. http://www.iana.org/domains/root/
      13. http://www.iana.org/domains/int/
      14. http://www.iana.org/domains/arpa/
      15. http://www.iana.org/domains/idn-tables/
      16. http://www.iana.org/protocols/
      17. http://www.iana.org/numbers/
      18. http://www.iana.org/abuse/
      19. http://www.icann.org/
      20. mailto:i...@iana.org?subject=General%20website%20feedback
    0
    $ ssh -T blood links2 http://example.net/ <&-; echo $?

      C-c C-c130
    $ ssh -T blood netrik http://example.net/ <&-; echo $?
    TERM environment variable not set.
    1
    $ 



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to