Published 2025-12-17.
Last modified 2026-03-05.
Time to read: 1 minutes.
This article helps set the startup position of Microsoft Terminal.
PowerShell Script
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
}
Running The Script
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.
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
Bugs
If the initialPosition has an invalid X or Y value, the
coordinate is silently ignored and the window is positioned at the top left of
the screen. Early in 2026, Microsoft Terminal Preview started treating all
explicit coordinates as invalid, while non-Preview Terminal continued to work.
The following fragment of
%LocalAppData%\
is the settings file for Microsoft Terminal (not Preview).
"initialCols": 269, "initialPosition": "-3830,1110",