%3CLINGO-SUB%20id%3D%22lingo-sub-1471164%22%20slang%3D%22en-US%22%3EUsing%20Go%20language%20to%20automate%20the%20Windows%20Terminal%20launching%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1471164%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22logo.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F199277i94A429AE02BFC133%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22logo.png%22%20alt%3D%22logo.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22go.jpg%22%20style%3D%22width%3A%20131px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F199256iE044D39B4AD73C93%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22go.jpg%22%20alt%3D%22go.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-1173932598%22%20id%3D%22toc-hId-1173932598%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22toc-hId--633521865%22%20id%3D%22toc-hId--633521865%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22toc-hId-1853990968%22%20id%3D%22toc-hId-1853990968%22%3ELet%E2%80%99s%20start!%3C%2FH3%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20first%20step%20is%20to%20download%20and%20install%20the%20Go%20language%20that%20is%20available%20at%3A%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E-ERR%3AREF-NOT-FOUND-%3CA%20href%3D%22https%3A%2F%2Fgolang.org%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgolang.org%2F%3C%2FA%3E%20.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EGo%20is%20an%20open%20source%20programming%20language%20that%20makes%20it%20easy%20to%20build%20simple%2C%20reliable%2C%20and%20efficient%20software.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22go%20learning.png%22%20style%3D%22width%3A%2075px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F199258i965CD6214771BAC1%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22go%20learning.png%22%20alt%3D%22go%20learning.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-46536505%22%20id%3D%22toc-hId-46536505%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22toc-hId--1760917958%22%20id%3D%22toc-hId--1760917958%22%3ELaunching%20Windows%20Terminal%20from%20Windows%20Explorer%20Address%20Bar%3C%2FH3%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20am%20pretty%20sure%20that%20you%20already%20know%20that%20typing%20CMD%20or%20PowerShell.exe%20on%20the%20Windows%20Explorer%20address%20bar%20will%20open%20the%20respective%20prompts%20in%20the%20same%20folder%20that%20it%20was%20displayed%20on%20Windows%20Explorer.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBut%20how%20to%20achieve%20the%20same%20behavior%20with%20Windows%20Terminal%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20type%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3Ewt%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FSTRONG%3Eon%20the%20address%20bar%2C%20Windows%20Terminal%20will%20not%20be%20launched%20in%20the%20same%20folder%20that%20Windows%20Explorer.%20In%20fact%2C%20Windows%20Terminal%20will%20be%20opened%20in%20the%20folder%20defined%20in%20the%20default%20profile.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22wt.gif%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F199259i7222EC4609E2B27E%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22wt.gif%22%20alt%3D%22wt.gif%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3Atriangular_flag%3A%20To%20open%20Windows%20Terminal%20in%20the%20same%20folder%20of%20Windows%20Explorer%20you%20need%20to%20run%20the%20following%20command%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20spellcheck%3D%22false%22%3Ewt%20-d%20.%0A%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22wt%20param.gif%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F199260i85CDC56F8904FA48%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22wt%20param.gif%22%20alt%3D%22wt%20param.gif%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20case%20you%20don't%20like%20to%20type%20the%20parameters%20for%20the%20wt%20command%2C%20you%20can%20use%20the%20language%20Go%20to%20reduce%20it%20to%20only%20a%20single%20command.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3Afolded_hands%3A%20I%20would%20like%20to%20thank%20my%20friend%20and%20teammate%20Alexandre%20Teoi%20that%20shared%20with%20me%20his%20implementation%20using%20Go%20to%20avoid%20having%20to%20pass%20parameters%20to%20wt%20command.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22git.jpg%22%20style%3D%22width%3A%20175px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F199262iECC6FA988853A90D%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22git.jpg%22%20alt%3D%22git.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20find%20Teoi's%20solution%20on%20GitHub%3A%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E-ERR%3AREF-NOT-FOUND-%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FDevelopersCommunity%2Fwtd%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FDevelopersCommunity%2Fwtd%3C%2FA%3E%20.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20implementation%20is%20straightforward.%20The%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3Ewtd.go%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FSTRONG%3Efile%2C%20available%20on%20GitHub%2C%20is%20used%20to%20run%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3Ewt%20-d%20.%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Ecommand%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22wtd%20go.png%22%20style%3D%22width%3A%20995px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F199266iB8C77122232EB684%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22wtd%20go.png%22%20alt%3D%22wtd%20go.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOnce%20you%20have%20installed%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EGo%3C%2FSTRONG%3E%2C%20run%20the%20following%20code%20to%20compile%20and%20install%20packages%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20spellcheck%3D%22false%22%3Ego%20install%20github.com%2FDevelopersCommunity%2Fwtd%0A%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3Atriangular_flag%3A%20It%20is%20also%20possible%20to%20clone%20the%20repository%20and%20install%20the%20App%20locally%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20spellcheck%3D%22false%22%3Ego%20install%20wtd.go%0A%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENow%20you%20can%20use%20wtd%20instead%20of%20wt%20to%20open%20Windows%20Terminal%20from%20Windows%20Explorer%20address%20bar%20without%20having%20to%20worry%20about%20pass%20the%20parameters.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22wtd.gif%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F199267i0F47F7E7261F65EA%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22wtd.gif%22%20alt%3D%22wtd.gif%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22go%20learning.png%22%20style%3D%22width%3A%2075px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F199258i965CD6214771BAC1%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22go%20learning.png%22%20alt%3D%22go%20learning.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-726594875%22%20id%3D%22toc-hId-726594875%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22toc-hId--1080859588%22%20id%3D%22toc-hId--1080859588%22%3EAutomating%20Windows%20Terminal%20launching%3C%2FH3%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20idea%20of%20this%20session%20is%20to%20demonstrate%20how%20to%20open%20Windows%20Terminal%20with%20three%20panels%20opened%20running%20different%20commands.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22wt%20split.gif%22%20style%3D%22width%3A%20539px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F199269i0D707E62DB5A5E40%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22wt%20split.gif%22%20alt%3D%22wt%20split.gif%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EThe%20first%20thing%20that%20you%20need%20to%20do%20is%20to%20create%20the%20following%20three%20profiles%20on%20Windows%20Terminal%20to%20host%20each%20panel.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22wt%20profiles.png%22%20style%3D%22width%3A%20977px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F199270i7EF61B9C4A51B5D1%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22wt%20profiles.png%22%20alt%3D%22wt%20profiles.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFollows%20the%20code%20that%20must%20be%20included%20in%20the%20session%20profiles%20of%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3Esettings.json%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Efile%20of%20Windows%20Terminal%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20spellcheck%3D%22false%22%3E%7B%0A%26nbsp%3B%20%26nbsp%3B%20%22guid%22%3A%20%22%7B0879968C-03C7-4B16-BF02-49CBF6046F59%7D%22%2C%0A%26nbsp%3B%20%26nbsp%3B%20%22fontFace%22%20%3A%20%22Cascadia%20Code%20PL%22%2C%0A%26nbsp%3B%20%26nbsp%3B%20%22name%22%3A%20%22Pane1%22%2C%0A%26nbsp%3B%20%26nbsp%3B%20%22backgroundImage%22%3A%20%22C%3A%5C%5Cpodcast%5C%5CWindows%20Terminal%5C%5Cwindows.png%22%2C%0A%26nbsp%3B%20%26nbsp%3B%20%22commandline%22%3A%20%22powershell.exe%20-noexit%20-command%20c%3A%5C%5Cusers%5C%5Cluisdem%5C%5Cpane1.ps1%22%0A%7D%2C%0A%0A%7B%0A%26nbsp%3B%20%26nbsp%3B%20%22guid%22%3A%20%22%7BC7A929B8-F4F5-4B30-9AE4-761BD582B036%7D%22%2C%0A%26nbsp%3B%20%26nbsp%3B%20%22fontFace%22%20%3A%20%22Cascadia%20Code%20PL%22%2C%0A%26nbsp%3B%20%26nbsp%3B%20%22name%22%3A%20%22Pane2%22%2C%0A%26nbsp%3B%20%26nbsp%3B%20%22backgroundImage%22%3A%20%22C%3A%5C%5Cpodcast%5C%5CWindows%20Terminal%5C%5Clinux.png%22%2C%0A%26nbsp%3B%20%26nbsp%3B%20%22commandline%22%3A%20%22powershell.exe%20-noexit%20-command%20c%3A%5C%5Cusers%5C%5Cluisdem%5C%5Cpane2.ps1%22%0A%7D%2C%0A%0A%7B%0A%26nbsp%3B%20%26nbsp%3B%20%22guid%22%3A%20%22%7BF7F214CA-48DF-4CB2-8B21-54D195867B14%7D%22%2C%0A%26nbsp%3B%20%26nbsp%3B%20%22fontFace%22%20%3A%20%22Cascadia%20Code%20PL%22%2C%0A%26nbsp%3B%20%26nbsp%3B%20%22name%22%3A%20%22Pane3%22%2C%0A%26nbsp%3B%20%26nbsp%3B%20%22backgroundImage%22%3A%20%22C%3A%5C%5Cpodcast%5C%5CWindows%20Terminal%5C%5Clinux.png%22%2C%0A%26nbsp%3B%20%26nbsp%3B%20%22commandline%22%3A%20%22powershell.exe%20-noexit%20-command%20c%3A%5C%5Cusers%5C%5Cluisdem%5C%5Cpane3.ps1%22%0A%7D%0A%0A%0A%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20my%20sample%2C%20I%20am%20running%20a%20PowerShell%20script%20for%20each%20profile%20(Pane1%2C%20Pane2%20and%20Pane3).%3C%2FP%3E%0A%3CP%3EThe%20content%20of%20those%20scripts%20are%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPane1.ps%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20spellcheck%3D%22false%22%3E%23First%20part%0Aget-process%0A%0A%23Second%20part%0A%0A%5Bvoid%5D%5BSystem.Reflection.Assembly%5D%3A%3ALoadWithPartialName('System.Windows.Forms')%0A%5BSystem.Windows.Forms.SendKeys%5D%3A%3ASendWait(%22%25%7BRIGHT%7D%22)%0A%0A%5Bvoid%5D%5BSystem.Reflection.Assembly%5D%3A%3ALoadWithPartialName('System.Windows.Forms')%0A%5BSystem.Windows.Forms.SendKeys%5D%3A%3ASendWait(%22%25%2B%7BUP%7D%22)%0A%0A%5Bvoid%5D%5BSystem.Reflection.Assembly%5D%3A%3ALoadWithPartialName('System.Windows.Forms')%0A%5BSystem.Windows.Forms.SendKeys%5D%3A%3ASendWait(%22%25%2B%7BUP%7D%22)%0A%0A%5Bvoid%5D%5BSystem.Reflection.Assembly%5D%3A%3ALoadWithPartialName('System.Windows.Forms')%0A%5BSystem.Windows.Forms.SendKeys%5D%3A%3ASendWait(%22%25%2B%7BUP%7D%22)%0A%0A%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20first%20part%20(%23First%20part)%20is%20used%20to%20list%20all%20the%20processes%20running%20and%20the%20second%20part%20(%23Second%20part)%20is%20used%20to%20invoke%20the%20short%20keys%20responsible%20to%20change%20the%20panel%20size.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%25%7BRIGHT%7D%3C%2FSTRONG%3E%3A%20is%20used%20to%20invoke%20the%20Shift%2BRight%20Arrow%20to%20change%20the%20focus%20to%20the%20right%20pane.%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%25%2B%7BUP%7D%3C%2FSTRONG%3E%3A%20is%20used%20to%20invoke%20the%20ALT%2BShift%2BUp%20Arrow%20to%20change%20the%20vertical%20size%20of%20the%20pane.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPane2.ps%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20spellcheck%3D%22false%22%3Ewsl%20cowsay%20%22Welcome%20to%20Windows%20Terminal%22%0Awsl%0Awsl%0A%0A%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPane3.ps%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20spellcheck%3D%22false%22%3Ewsl%20cmatrix%0Awsl%0A%0A%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFinally%20we%20can%20use%20Go%20to%20create%20the%20App%20that%20will%20open%20Windows%20Terminal%20with%20the%20three%20new%20profiles%20running%20in%20different%20panes.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20idea%20is%20to%20run%20the%20following%20command%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20spellcheck%3D%22false%22%3Ewt%20-p%20%22Pane1%22%20%60%3B%20split-pane%20-p%20%22Pane2%22%20%60%3B%20split-pane%20-H%20-p%20%22Pane3%22%0A%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAll%20you%20have%20to%20do%20is%20to%20create%20a%20file%2C%20like%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3Ewtp.go%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eand%20implement%20the%20following%20code%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20spellcheck%3D%22false%22%3Epackage%26nbsp%3Bmain%0A%0Aimport%26nbsp%3B(%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%22fmt%22%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%22os%2Fexec%22%0A)%0A%0Afunc%26nbsp%3Bmain()%26nbsp%3B%7B%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3Bcmd%26nbsp%3B%3A%3D%26nbsp%3B%26amp%3Bexec.Cmd%7B%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BPath%3A%26nbsp%3B%22cmd%22%2C%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BArgs%3A%26nbsp%3B%5B%5Dstring%7B%22%2Fc%22%2C%26nbsp%3B%22start%22%2C%26nbsp%3B%22wt%22%2C%26nbsp%3B%22-p%22%2C%26nbsp%3B%22Pane1%22%2C%26nbsp%3B%22%60%3B%22%2C%26nbsp%3B%22split-pane%22%2C%26nbsp%3B%22-p%22%2C%26nbsp%3B%22Pane2%22%2C%26nbsp%3B%22%60%3B%22%2C%26nbsp%3B%22split-pane%22%2C%26nbsp%3B%22-H%22%2C%26nbsp%3B%22-p%22%2C%26nbsp%3B%22Pane3%22%7D%2C%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%7D%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3Bif%26nbsp%3Berr%26nbsp%3B%3A%3D%26nbsp%3Bcmd.Start()%3B%26nbsp%3Berr%26nbsp%3B!%3D%26nbsp%3Bnil%26nbsp%3B%7B%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3Bfmt.Printf(%22Error%3A%26nbsp%3B%25s%5Cn%22%2C%26nbsp%3Berr)%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%7D%0A%7D%0A%0A%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFollows%20the%20wtp.go%20file%20opened%20on%20Visual%20Studio%20Code%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22wtp%20vscode.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F199274iF4383787E9D8E39A%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22wtp%20vscode.png%22%20alt%3D%22wtp%20vscode.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOnce%20we%20have%20the%20file%2C%20we%20need%20to%20compile%20and%20install%20the%20App%20through%20the%20following%20command%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20spellcheck%3D%22false%22%3Ego%20install%20wtp.go%0A%0A%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENow%2C%20all%20you%20have%20to%20do%20is%20to%20execute%20wtp%20to%20launch%20this%20customized%20Windows%20Terminal%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22wtp%20run.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F199276i10B50CF44D754C00%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22wtp%20run.png%22%20alt%3D%22wtp%20run.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20post%20is%20just%20to%20demonstrate%20how%20to%20use%20Go%20language%20to%20customize%20some%20actions%20to%20open%20Windows%20Terminal.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIt%20is%20possible%20to%20achieve%20the%20same%20behavior%20using%20other%20languages.%20%3Abeaming_face_with_smiling_eyes%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20hope%20you%20enjoyed%20this%20post.%20%3Athumbs_up%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1471164%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22logo.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F199255i3CDE49440157AE0D%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22logo.png%22%20alt%3D%22logo.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20this%20post%20I%20will%20demonstrate%20how%20to%20use%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EGo%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eto%20automate%20the%20Windows%20Terminal%20initialization.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EGo%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Ewill%20be%20used%20to%20implement%20a%20small%20App%20to%20open%20Windows%20Terminal%20with%20three%20panels%20running%20different%20commands%20in%20each.%20I%20will%20also%20use%20the%20code%20that%20my%20friend%20Alexandre%20Teoi%20wrote%20to%20simplify%20the%20syntax%20to%20open%20Windows%20Terminal%20from%20the%20Windows%20Explorer%20address%20bar.%3C%2FP%3E%3C%2FLINGO-TEASER%3E
Microsoft

 

logo.png

 

 

go.jpg

 

 

Let’s start!

 

The first step is to download and install the Go language that is available at: https://golang.org/ .

 

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software. 

 

go learning.png

 

 

Launching Windows Terminal from Windows Explorer Address Bar

 

I am pretty sure that you already know that typing CMD or PowerShell.exe on the Windows Explorer address bar will open the respective prompts in the same folder that it was displayed on Windows Explorer.

 

But how to achieve the same behavior with Windows Terminal?

 

If you type wt on the address bar, Windows Terminal will not be launched in the same folder that Windows Explorer. In fact, Windows Terminal will be opened in the folder defined in the default profile.

 

 

wt.gif

 

 

 

:triangular_flag: To open Windows Terminal in the same folder of Windows Explorer you need to run the following command:

 

 

wt -d .

 

 

wt param.gif

 

 

In case you don't like to type the parameters for the wt command, you can use the language Go to reduce it to only a single command.

 

 

:folded_hands: I would like to thank my friend and teammate Alexandre Teoi that shared with me his implementation using Go to avoid having to pass parameters to wt command.

 

 

 

git.jpg

 

 

You can find Teoi's solution on GitHub: https://github.com/DevelopersCommunity/wtd .

 

The implementation is straightforward. The wtd.go file, available on GitHub, is used to run the wt -d . command:

 

 

wtd go.png

 

 

Once you have installed Go, run the following code to compile and install packages:

 

go install github.com/DevelopersCommunity/wtd

 

 

:triangular_flag: It is also possible to clone the repository and install the App locally:

 

 

go install wtd.go

 

 

Now you can use wtd instead of wt to open Windows Terminal from Windows Explorer address bar without having to worry about pass the parameters.

 

 

wtd.gif

 

 

 

 

go learning.png

 

 

Automating Windows Terminal launching

 

The idea of this session is to demonstrate how to open Windows Terminal with three panels opened running different commands.

 

 

wt split.gif

 

 

The first thing that you need to do is to create the following three profiles on Windows Terminal to host each panel.

 

 

wt profiles.png

 

 

 

Follows the code that must be included in the session profiles of the settings.json file of Windows Terminal:

 

 

{
    "guid": "{0879968C-03C7-4B16-BF02-49CBF6046F59}",
    "fontFace" : "Cascadia Code PL",
    "name": "Pane1",
    "backgroundImage": "C:\\podcast\\Windows Terminal\\windows.png",
    "commandline": "powershell.exe -noexit -command c:\\users\\luisdem\\pane1.ps1"
},

{
    "guid": "{C7A929B8-F4F5-4B30-9AE4-761BD582B036}",
    "fontFace" : "Cascadia Code PL",
    "name": "Pane2",
    "backgroundImage": "C:\\podcast\\Windows Terminal\\linux.png",
    "commandline": "powershell.exe -noexit -command c:\\users\\luisdem\\pane2.ps1"
},

{
    "guid": "{F7F214CA-48DF-4CB2-8B21-54D195867B14}",
    "fontFace" : "Cascadia Code PL",
    "name": "Pane3",
    "backgroundImage": "C:\\podcast\\Windows Terminal\\linux.png",
    "commandline": "powershell.exe -noexit -command c:\\users\\luisdem\\pane3.ps1"
}


 

 

In my sample, I am running a PowerShell script for each profile (Pane1, Pane2 and Pane3).

The content of those scripts are:

 

 

Pane1.ps:

 

#First part
get-process

#Second part

[void][System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms')
[System.Windows.Forms.SendKeys]::SendWait("%{RIGHT}")

[void][System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms')
[System.Windows.Forms.SendKeys]::SendWait("%+{UP}")

[void][System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms')
[System.Windows.Forms.SendKeys]::SendWait("%+{UP}")

[void][System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms')
[System.Windows.Forms.SendKeys]::SendWait("%+{UP}")

 

 

The first part (#First part) is used to list all the processes running and the second part (#Second part) is used to invoke the short keys responsible to change the panel size.

 

%{RIGHT}: is used to invoke the Shift+Right Arrow to change the focus to the right pane.

%+{UP}: is used to invoke the ALT+Shift+Up Arrow to change the vertical size of the pane.

 

 

Pane2.ps:

 

wsl cowsay "Welcome to Windows Terminal"
wsl
wsl

 

 

Pane3.ps:

 

wsl cmatrix
wsl

 

 

Finally we can use Go to create the App that will open Windows Terminal with the three new profiles running in different panes.

 

 

The idea is to run the following command:

 

wt -p "Pane1" `; split-pane -p "Pane2" `; split-pane -H -p "Pane3"

 

 

All you have to do is to create a file, like wtp.go and implement the following code:

 

 

package main

import (
    "fmt"
    "os/exec"
)

func main() {
    cmd := &exec.Cmd{
        Path: "cmd",
        Args: []string{"/c", "start", "wt", "-p", "Pane1", "`;", "split-pane", "-p", "Pane2", "`;", "split-pane", "-H", "-p", "Pane3"},
    }
    if err := cmd.Start(); err != nil {
        fmt.Printf("Error: %s\n", err)
    }
}

 

 

Follows the wtp.go file opened on Visual Studio Code:

 

 

wtp vscode.png

 

 

 

Once we have the file, we need to compile and install the App through the following command:

 

 

go install wtp.go

 

Now, all you have to do is to execute wtp to launch this customized Windows Terminal:

 

 

wtp run.png

 

 

This post is just to demonstrate how to use Go language to customize some actions to open Windows Terminal.

 

 

It is possible to achieve the same behavior using other languages. :beaming_face_with_smiling_eyes:

 

 

I hope you enjoyed this post. :thumbs_up: