Skip to content

Instantly share code, notes, and snippets.

@terremoth
Last active January 9, 2026 18:25
Show Gist options
  • Select an option

  • Save terremoth/81734191ff5ea5b1af4c1ec2b526e210 to your computer and use it in GitHub Desktop.

Select an option

Save terremoth/81734191ff5ea5b1af4c1ec2b526e210 to your computer and use it in GitHub Desktop.
get windows cmd/terminal information
<?php
$tty = array_map(fn($line) => $line[1], array_filter(array_map(fn($line)=> explode(":", $line), array_map(fn($line) =>
preg_replace("/\s+/", "", $line),explode("\n", shell_exec("mode con")))), fn($line) => count($line)>1));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment