diff --git a/src/console/PhutilInteractiveEditor.php b/src/console/PhutilInteractiveEditor.php --- a/src/console/PhutilInteractiveEditor.php +++ b/src/console/PhutilInteractiveEditor.php @@ -58,6 +58,10 @@ $name = $this->getName(); $content = $this->getContent(); + if (phutil_is_windows()) { + $content = str_replace("\n", "\r\n", $content); + } + $tmp = Filesystem::createTemporaryDirectory('edit.'); $path = $tmp.DIRECTORY_SEPARATOR.$name; @@ -86,6 +90,10 @@ throw $ex; } + if (phutil_is_windows()) { + $result = str_replace("\r\n", "\n", $result); + } + $this->setContent($result); return $this->getContent();