Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

cybardev/wt-dropdown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 

Repository files navigation

Windows Terminal Dropdown

Automatically activate the built-in dropdown mode of Windows Terminal

windows-terminal

Windows Terminal has a built-in dropdown mode, but there's no way to passively keep it on in the background at startup. The only way to activate it from my experience is to open an instance of the app, press the hotkey for the dropdown (Win+` by default) to activate it, press it again to hide it, then close the first instance.

This script does that all in one go, given that wt.exe is on the $PATH. I've set it as a Startup program since I regularly need the dropdown and manually executing this everytime is inefficient.

PS: This was intended for my personal use only. It may or may not work for you. Please use at your own discretion.

Usage

  1. Download the wt-dropdown.au3 script
  2. Edit the tabName variable in the script to the default tab name of your Windows Terminal
  3. Make any other changes you may want
  4. Install according to the instructions below

Install

  1. Install AutoIt3
  2. Create an executable from the wt-dropdown.au3 script using the installed tool
  3. Place created executable in your startup directory: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp

Source

  • wt-dropdown.au3 :
; variables to change
$termName = "wt.exe"  ; terminal program
$tabName = "Kali"     ; default tab name
$hotKey = "#`"        ; dropdown hotkey

; start terminal and trigger dropdown
Run($termName)
WinWaitActive($tabName)
Send($hotKey)
WinWaitActive($tabName)

; check for dropdown
If WinGetPos($tabName)[0] < 0 Then
	; hide dropdown then close window
	Send($hotKey)
	WinWaitActive($tabName)
	WinClose($tabName)
Else
	; close window then hide dropdown
	WinClose($tabName)
	WinWaitActive($tabName)
	Send($hotKey)
EndIf

Credits

Windows Terminal icon taken from the Microsoft/Terminal GitHub repository.

License

Script and website content: GPLv3

Windows Terminal icon and the Jekyll theme for this website may have different license terms. Please check them out at their official repositories.