Terminal control/Dimensions: Difference between revisions

Rename Perl 6 -> Raku, alphabetize, minor clean-up
(Rename Perl 6 -> Raku, alphabetize, minor clean-up)
Line 292:
fmt.Println(height, width)
}</lang>
 
=={{header|Nim}}==
 
<lang nim>import terminal
 
echo "Terminal width: " & $terminalWidth()
echo "Terminal height: " & $terminalHeight()
</lang>
 
=={{header|J}}==
Line 310 ⟶ 302:
 
Note also that this will typically include 37 extra pixels horizontally and 79 extra pixels vertically, which are not available to display text. In other words, if the result was 700 500 you would really have 663 pixels of width and 421 pixels of height.
 
 
=={{header|Julia}}==
Line 376 ⟶ 367:
<lang Mathematica>WIDTH=RunThrough["tput cols", ""];
HEIGHT=RunThrough["tput lines", ""];</lang>
 
=={{header|Nim}}==
 
<lang nim>import terminal
 
echo "Terminal width: " & $terminalWidth()
echo "Terminal height: " & $terminalHeight()
</lang>
 
=={{header|OCaml}}==
Line 394 ⟶ 393:
print "The terminal has $cols columns and $rows lines\n";</lang>
 
=={{header|Perl 6}}==
Using <i>stty</i> just for the heck of it.
<lang perl6>my $stty = qx[stty -a];
my $lines = $stty.match(/ 'rows ' <( \d+/);
my $cols = $stty.match(/ 'columns ' <( \d+/);
say "$lines $cols";</lang>
=={{header|Phix}}==
The buffer is usually somewhat larger (and never smaller) than the current physical screen size. I would guess that most applications are more interested in the latter.
Line 491 ⟶ 484:
(charterm-screen-size))
</lang>
 
=={{header|Perl 6Raku}}==
(formerly Perl 6)
Using <i>stty</i> just for the heck of it.
<lang perl6>my $stty = qx[stty -a];
my $lines = $stty.match(/ 'rows ' <( \d+/);
my $cols = $stty.match(/ 'columns ' <( \d+/);
say "$lines $cols";</lang>
 
=={{header|Retro}}==
Line 568 ⟶ 569:
val (lines, columns) = (System.getenv("LINES"), System.getenv("COLUMNS"))
println(s"Lines = $lines, Columns = $columns")</lang>
 
=={{header|Seed7}}==
The functions [http://seed7.sourceforge.net/libraries/console.htm#height%28ref_console_file%29 height] and
10,327

edits