Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

希望可以加入清屏快捷键 #265

Closed
suyin-long opened this issue Feb 24, 2021 · 4 comments
Closed

希望可以加入清屏快捷键 #265

suyin-long opened this issue Feb 24, 2021 · 4 comments
Labels
tips-and-tricks Guides that should be added to the "Tips and Tricks" page

Comments

@suyin-long
Copy link

[在此处输入反馈]

希望可以加入清屏快捷键,就是那个在终端下输入“cls”清屏的功能,快捷键如:“ctrl+l”

文档详细信息

请勿编辑此部分。 docs.microsoft.com ➟ GitHub 问题链接必须具有此部分。

@skyline75489
Copy link

See microsoft/terminal#9603

@zadjii-msft
Copy link
Contributor

Yea, we should add this to tips and tricks. Someone could polish my previous comment:

microsoft/terminal#1802 has a lot more details on why this is currently hard to do.

You might be able to get away with

        { "command": { "action": "sendInput", "input": "clear\r" }, "keys":"ctrl+k", "name": "clear terminal" },

which will manually send "clearenter" to the terminal. Adjust as needed for your preferred shell.

@zadjii-msft zadjii-msft added the tips-and-tricks Guides that should be added to the "Tips and Tricks" page label Apr 7, 2021
@suyin-long
Copy link
Author

suyin-long commented Apr 8, 2021

我使用的时候发现 clear\r 不太好用,于是改成了 cls\r ,整体代码如下:

{
    "command": {
        "action": "sendInput",
        "input": "cls\r"
    },
    "keys": "ctrl+l",
    "name": "clear terminal"
}

这里的快捷键也改成了linux上熟悉的 ctrl+l

@mattwojo
Copy link
Collaborator

mattwojo commented Oct 4, 2021

Added instructions to clear screen in the Tips and Tricks doc. c129590
Thank you for filing this issue! :)

@mattwojo mattwojo closed this as completed Oct 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tips-and-tricks Guides that should be added to the "Tips and Tricks" page
Projects
None yet
Development

No branches or pull requests

4 participants