Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F18205833
D14203.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
559 B
Referenced Files
None
Subscribers
None
D14203.diff
View Options
diff --git a/src/console/format.php b/src/console/format.php
--- a/src/console/format.php
+++ b/src/console/format.php
@@ -187,8 +187,19 @@
if ($width === null) {
if (phutil_is_windows()) {
- // TODO: Figure out how to get this working in Windows.
- return null;
+
+ preg_match('/(\n[^|]+?){4}(\d+)/', `mode con`, $matches);
+
+ if(is_array($matches)&&isset($matches[2])&&!empty($matches[2])) {
+
+ return (int)$matches[2];
+
+ }else {
+
+ return null;
+
+ }
+
}
$tmp = new TempFile();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Aug 19, 3:09 PM (3 d, 16 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
9624761
Default Alt Text
D14203.diff (559 B)
Attached To
Mode
D14203: Implement phutil_console_get_terminal_width for windows
Attached
Detach File
Event Timeline
Log In to Comment