Published 2025-12-17.
Time to read: 1 minutes.
This article help you set the startup position of Microsoft Terminal.
The following PowerShell script tracks the mouse across multiple monitors.
# multiscreen.ps1 - Live Mouse Coordinate Tracker for 2025
# Mike Slinn mslinn@mslinn.com
Add-Type -AssemblyName System.Windows.Forms
Write-Host "--- Multi-Screen Coordinate Tracker ---" -ForegroundColor Cyan
Write-Host "Press CTRL+C to stop the script.`n" -ForegroundColor Yellow
while ($true) {
# Get current global mouse position
$pos = [System.Windows.Forms.Cursor]::Position
# Get all screens to identify which one the mouse is on
$currentScreen = [System.Windows.Forms.Screen]::FromPoint($pos)
$screenName = $currentScreen.DeviceName.Replace("\\.\", "")
# Construct the display string
$output = "`r[Screen: $screenName] | X: $($pos.X.ToString().PadRight(6)) | Y: $($pos.Y.ToString().PadRight(6))"
# Write to console without a new line for a "live" dashboard feel
Write-Host $output -NoNewline
Start-Sleep -Milliseconds 50
}
Enable script execution:
PS C:\WINDOWS\system32> Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force
See Add To Windows User Path
if you need to add the directory you saved multiscreen.ps1 to the Windows user path.
The following multiscreen.ps1 can be run in any PowerShell.
PS C:\Users\Mike Slinn> multiscreen.ps1 --- Multi-Screen Coordinate Tracker --- Press CTRL+C to stop the script. [Screen: DISPLAY2] | X: -1524 | Y: 678
The following shows the number of characters the current Bash terminal can display:
$ echo $COLUMNS 209