有没有办法在玉米饼控制台窗口中对输出进行分类?

发布于 2025-02-13 17:47:40 字数 433 浏览 0 评论 0原文

我可以在Tortoisehg控制台窗口中运行HG命令。有时,我想管道到另一个命令以过滤输出或排序。不太确定如何在Tortoisehg中执行此操作(尽管我知道我可以在“ CMD”窗口中运行HG命令,然后将管道像普通批处理文件一样到另一个命令)。

我已经尝试了UNIX和Windows CMD版本的输出输出版本。作为一个简单的示例(说明问题,但不一定是我可以尝试的限制...):

Unix:  hg branches | grep -i inactive 
CMD:   hg branches | findstr /I inactive

这些都不会在Tortoisehg “ Console” 窗口中使用。我发现在控制台窗口中运行命令比在CMD壳中更方便,因为我的键入命令将按时间顺序显示,并通过GUI执行其他命令(通常在控制台窗口中显示)。

I can run hg commands in the TortoiseHg console window. Sometimes I want to pipe to another command to filter output or sort. Not really sure how to do this in TortoiseHg (although I know I can run hg commands in the 'Cmd' window and pipe to another command like a normal batch file).

I've tried both Unix and Windows CMD versions of piping the output. As a simple example (to illustrate the issue, but not necessarily the limits of what I could try...):

Unix:  hg branches | grep -i inactive 
CMD:   hg branches | findstr /I inactive

Neither of these will work in the TortoiseHg "Console" window. I would find it more convenient to run commands in the console window than in the CMD shell as my typed commands would be shown chronologically with other commands executed via the GUI (that normally show in the Console window).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

爱她像谁 2025-02-20 17:47:40
  1. 即使您的主机操作系统是Windows,您也可以(现在)有2个命令中的外壳(直接或作为THG中的终端窗口):经典CMD和PowerShell。定义您使用的哪种类型将更适合更快地了解问题
  2. 相同的外壳,因为命令 - 预付款或终端将产生与CMD样本“ Just Work”的绝对相同的结果

,在这里看不到任何麻烦(Win32CHCP是本地扩展控制台输出,与任务无关)

端子Thg

THG\hg-git>hg branches | findstr /I inactive
[win32chcp] switching your console encoding into cp1251
1.0.x                       2155:ae8b3247c149 (inactive)
0.10.x                      2118:4a18ab4b2fed (inactive)

THG\hg-git>

cmd-window

Microsoft Windows [Version 10.0.19043.1766]
(c) Microsoft Corporation. All rights reserved.

THG\hg-git>hg branches | findstr /I inactive
[win32chcp] switching your console encoding into cp1251
1.0.x                       2155:ae8b3247c149 (inactive)
0.10.x                      2118:4a18ab4b2fed (inactive)

THG\hg-git>
  1. Even if your host OS is Windows, you can have (now) 2 shells in command-prompt (directly or as Terminal Window in THG): classic CMD and PowerShell. Defining which type you use will be better for faster understanding of a problem
  2. Same shell as command-prompt or Terminal will produce absolutely the same result

Your cmd-sample "just work", can't see any troubles here (win32chcp is local extension for console outputs, irrelevant to tasks)

Terminal THG

THG\hg-git>hg branches | findstr /I inactive
[win32chcp] switching your console encoding into cp1251
1.0.x                       2155:ae8b3247c149 (inactive)
0.10.x                      2118:4a18ab4b2fed (inactive)

THG\hg-git>

CMD-window

Microsoft Windows [Version 10.0.19043.1766]
(c) Microsoft Corporation. All rights reserved.

THG\hg-git>hg branches | findstr /I inactive
[win32chcp] switching your console encoding into cp1251
1.0.x                       2155:ae8b3247c149 (inactive)
0.10.x                      2118:4a18ab4b2fed (inactive)

THG\hg-git>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文