shell - 回车符在 PowerShell ISE 中无法按预期工作

标签 shell powershell carriage-return powershell-ise

我有这个命令:

Write-Host "123`r456" 

独立 PowerShell 中的输出:

456 

PowerShell ISE 中的输出:

123456 

谢谢。

最佳答案

ISE 在很多方面的表现与普通控制台不同。虽然您希望回车符将位置重置为行的第一个字符,从而给出输出 456,但 ISE 不会以这种方式工作,因此不要依赖于该行为。

这是 ISE 与普通控制台之间未记录的差异之一。记录的内容在这里:http://blogs.msdn.com/b/powershell/archive/2009/04/17/differences-between-the-ise-and-powershell-console.aspx

关于shell - 回车符在 PowerShell ISE 中无法按预期工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9357052/

相关文章:

.net - 我可以在 powershell 中执行此操作吗?读取注册表,将二进制内容写入文件

powershell - Teamcity 与 powershell 脚本的交互

git - Git 处理 CRLF(回车、换行)的策略是什么?

git - 如何阻止 Git 在本地文件中插入回车符?

linux - Subversion 的预提交 Hook 失败

linux - 如何在不重启 byobu 的情况下使 ~/.byobu/.tmux.conf 中的更改生效

bash - 使用 Bash 批量重命名文件

powershell - 无法在 Windows 8.1 上更改 PowerShell 字体和窗口大小

LINUX 如何删除包含某个名称的文件?

xpath - wso2 esb xpath substring-before特殊字符回车