In linux terminal as I give ctrl+L signal, terminal screen clears. since I am new in windows programming and I found that cls command is used to clear screen. How can I make ctrl+L signal in case of windows cmd to clear screen.
how to implement ctrl+l for windows cmd?
Rather than giving -1 .... one should also explain what is wrong and how to correct it. –
Superfuse
You should use the cls command as a key shortcut will be more difficult. There is something called AutoHotkey, you can try that and tell us if that helped you :)
For anyone still stumbling upon this post, as it comes up first in Google search:
With the new Windows Terminal, you can go under Settings -> Actions -> Add new -> Clear buffer and set the hotkey you want.
You should use the cls command as a key shortcut will be more difficult. There is something called AutoHotkey, you can try that and tell us if that helped you :)
This scripts works for the CMD shell, with Autohotkey 2.0
#SingleInstance
#Requires Autohotkey v2.0
#HotIf WinActive("ahk_class ConsoleWindowClass")
^L::{
SendText("cls")
Send("{Enter}")
return
}
#HotIf
© 2022 - 2025 — McMap. All rights reserved.