WindTerm icon indicating copy to clipboard operation
WindTerm copied to clipboard

对于cmd/powershell会话,clear清屏不能重置命令行数 | For cmd/powershell sessions, clear screen cannot reset the number of command lines

Open tp20c5 opened this issue 2 years ago • 4 comments

系统环境:Windows10 22H2 软件版本:WindTerm 2.5.0

问题描述: 对于ssh会话,clear可以将历史操作记录清空,行号清零。但当使用cmd或powershell会话时,cls或clear命令虽然也能清屏,但行号不会重置,而是继续累加。想要重置命令行号只能彻底关闭当前会话再新建一个。 For ssh sessions, clear can clear the historical operation records and clear the line numbers to zero. But when using cmd or powershell session, although the cls or clear command can also clear the screen, the line number will not be reset, but will continue to accumulate. If you want to reset the command line number, you can only completely close the current session and create a new one. image

而直接win+r运行cmd或者powershell,使用clear清屏命令是可以清空并重置操作记录的,所以应该不是原生命令不支持? And directly run cmd or powershell with win+r, and use the clear screen command to clear and reset the operation records, so it shouldn't be that the native command is not supported? Is that a problem? image

tp20c5 avatar Dec 19 '23 08:12 tp20c5

I mean, the clear command does clear the windterm powershell session (turn the page), but it doesn't clear the operation record like it does on the native system

tp20c5 avatar Dec 19 '23 08:12 tp20c5

如果是本地终端,多clear几次,无论是Linux还是CMD、Powershell 如果是通过 ssh 连接的远程Windows Powershell,可能会发现 clear 完全失效 如果你真的很在意,右键->全部清除,可以解决一切 clear 无法解决的问题

mrhan1993 avatar Dec 22 '23 06:12 mrhan1993

如果是本地终端,多clear几次,无论是Linux还是CMD、Powershell 如果是通过 ssh 连接的远程Windows Powershell,可能会发现 clear 完全失效 如果你真的很在意,右键->全部清除,可以解决一切 clear 无法解决的问题

是同一个版本么?没看到哪里有右键全部清除选项。ssh远程到bash shell的clear都能正常工作。这里讲的就是通过windterm打开的本地shell://powershell连接。目前只发现一个办法清零,就是完全删除会话再新建一个会话,哪怕断开、重连会话都冇用,必须删除原会话。 经你这一提醒,我又发现本地的wsl1或git bash在windterm中打开,也会无法clear掉历史记录,只是进行翻页操作。同时运行在原生终端窗口的clear都是工作正常。

tp20c5 avatar Dec 22 '23 08:12 tp20c5

如果是本地终端,多clear几次,无论是Linux还是CMD、Powershell 如果是通过 ssh 连接的远程Windows Powershell,可能会发现 clear 完全失效 如果你真的很在意,右键->全部清除,可以解决一切 clear 无法解决的问题

是同一个版本么?没看到哪里有右键全部清除选项。ssh远程到bash shell的clear都能正常工作。这里讲的就是通过windterm打开的本地shell://powershell连接。目前只发现一个办法清零,就是完全删除会话再新建一个会话,哪怕断开、重连会话都冇用,必须删除原会话。 经你这一提醒,我又发现本地的wsl1或git bash在windterm中打开,也会无法clear掉历史记录,只是进行翻页操作。同时运行在原生终端窗口的clear都是工作正常。

我用的是最新2.6pre release5

mrhan1993 avatar Dec 22 '23 14:12 mrhan1993