Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: To find out console line size in char.s .

by johngg (Canon)
on Mar 13, 2014 at 09:27 UTC ( [id://1078143]=note: print w/replies, xml ) Need Help??


in reply to To find out console line size in char.s .

Expanding on robby_dobby's answer, if the terminal is resized it should generate a $SIG{ WINCH } so install a handler to recalculate terminal size on receipt of that signal.

$SIG{ WINCH } = sub { # get new terminal size here };

I hope this is helpful.

Cheers,

JohnGG

Replies are listed 'Best First'.
Re^2: To find out console line size in char.s .
by robby_dobby (Hermit) on Mar 13, 2014 at 17:07 UTC

    Yes, but note that this may not be very portable:

    use Config; my @names = split ' ', $Config{sig_name}; print grep /WINCH/, @names;

    This does not print anything on Windows, but gives me results on cygwin and Linux(Slackware). To OP: As always, read the documentation (man 7 signal). This SO post may also shed some light on SIGWINCH for Windows OSes.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1078143]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2024-04-19 01:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found