Skip to content

Commit aebfe2b

Browse files
Feature: Added shortcut to open folders in terminal (#11192)
1 parent 5a60cca commit aebfe2b

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

src/Files.App/Views/ColumnShellPage.xaml.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
using System;
3030
using System.Collections.Generic;
3131
using System.ComponentModel;
32+
using System.Diagnostics;
3233
using System.Linq;
3334
using System.Runtime.CompilerServices;
3435
using System.Threading;
@@ -236,7 +237,14 @@ private async void ColumnShellPage_PreviewKeyDown(object sender, KeyRoutedEventA
236237
{
237238
path = SlimContentPage.SelectedItem.ItemPath;
238239
}
239-
// TODO open path in Windows Terminal
240+
241+
var terminalStartInfo = new ProcessStartInfo()
242+
{
243+
FileName = "wt.exe",
244+
WorkingDirectory = path
245+
};
246+
Process.Start(terminalStartInfo);
247+
240248
args.Handled = true;
241249
break;
242250

src/Files.App/Views/ModernShellPage.xaml.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
using System;
2929
using System.Collections.Generic;
3030
using System.ComponentModel;
31+
using System.Diagnostics;
3132
using System.IO;
3233
using System.Linq;
3334
using System.Runtime.CompilerServices;
@@ -222,7 +223,13 @@ private async void ModernShellPage_PreviewKeyDown(object sender, KeyRoutedEventA
222223
if (SlimContentPage?.SelectedItem?.PrimaryItemAttribute == StorageItemTypes.Folder)
223224
path = SlimContentPage.SelectedItem.ItemPath;
224225

225-
// TODO open path in Windows Terminal
226+
var terminalStartInfo = new ProcessStartInfo()
227+
{
228+
FileName = "wt.exe",
229+
WorkingDirectory = path
230+
};
231+
Process.Start(terminalStartInfo);
232+
226233
break;
227234

228235
case (false, false, false, true, VirtualKey.Space): // space, quick look

0 commit comments

Comments
 (0)