From 0dbad8adadb88a28014a8d1ad2778e828737085c Mon Sep 17 00:00:00 2001 From: ferrariofilippo Date: Mon, 6 Feb 2023 22:13:23 +0100 Subject: [PATCH 1/2] Feature: Open in Terminal shortcut --- src/Files.App/Views/ColumnShellPage.xaml.cs | 10 +++++++++- src/Files.App/Views/ModernShellPage.xaml.cs | 9 ++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/Files.App/Views/ColumnShellPage.xaml.cs b/src/Files.App/Views/ColumnShellPage.xaml.cs index 601722f82561..51a69200797c 100644 --- a/src/Files.App/Views/ColumnShellPage.xaml.cs +++ b/src/Files.App/Views/ColumnShellPage.xaml.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using System.ComponentModel; +using System.Diagnostics; using System.Linq; using System.Runtime.CompilerServices; using System.Threading; @@ -236,7 +237,14 @@ private async void ColumnShellPage_PreviewKeyDown(object sender, KeyRoutedEventA { path = SlimContentPage.SelectedItem.ItemPath; } - // TODO open path in Windows Terminal + + var terminalStartInfo = new ProcessStartInfo() + { + FileName = "cmd.exe", + WorkingDirectory = path + }; + Process.Start(terminalStartInfo); + args.Handled = true; break; diff --git a/src/Files.App/Views/ModernShellPage.xaml.cs b/src/Files.App/Views/ModernShellPage.xaml.cs index c666da6c6476..e2f0f4134b3e 100644 --- a/src/Files.App/Views/ModernShellPage.xaml.cs +++ b/src/Files.App/Views/ModernShellPage.xaml.cs @@ -28,6 +28,7 @@ using System; using System.Collections.Generic; using System.ComponentModel; +using System.Diagnostics; using System.IO; using System.Linq; using System.Runtime.CompilerServices; @@ -222,7 +223,13 @@ private async void ModernShellPage_PreviewKeyDown(object sender, KeyRoutedEventA if (SlimContentPage?.SelectedItem?.PrimaryItemAttribute == StorageItemTypes.Folder) path = SlimContentPage.SelectedItem.ItemPath; - // TODO open path in Windows Terminal + var terminalStartInfo = new ProcessStartInfo() + { + FileName = "cmd.exe", + WorkingDirectory = path + }; + Process.Start(terminalStartInfo); + break; case (false, false, false, true, VirtualKey.Space): // space, quick look From 9d132e1a0cd6ec325759b6f76b9bf610fadcecd4 Mon Sep 17 00:00:00 2001 From: ferrariofilippo Date: Mon, 6 Feb 2023 22:55:52 +0100 Subject: [PATCH 2/2] Windows Terminal --- src/Files.App/Views/ColumnShellPage.xaml.cs | 2 +- src/Files.App/Views/ModernShellPage.xaml.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Files.App/Views/ColumnShellPage.xaml.cs b/src/Files.App/Views/ColumnShellPage.xaml.cs index 51a69200797c..af2d466150bd 100644 --- a/src/Files.App/Views/ColumnShellPage.xaml.cs +++ b/src/Files.App/Views/ColumnShellPage.xaml.cs @@ -240,7 +240,7 @@ private async void ColumnShellPage_PreviewKeyDown(object sender, KeyRoutedEventA var terminalStartInfo = new ProcessStartInfo() { - FileName = "cmd.exe", + FileName = "wt.exe", WorkingDirectory = path }; Process.Start(terminalStartInfo); diff --git a/src/Files.App/Views/ModernShellPage.xaml.cs b/src/Files.App/Views/ModernShellPage.xaml.cs index e2f0f4134b3e..18e524b0ed43 100644 --- a/src/Files.App/Views/ModernShellPage.xaml.cs +++ b/src/Files.App/Views/ModernShellPage.xaml.cs @@ -225,7 +225,7 @@ private async void ModernShellPage_PreviewKeyDown(object sender, KeyRoutedEventA var terminalStartInfo = new ProcessStartInfo() { - FileName = "cmd.exe", + FileName = "wt.exe", WorkingDirectory = path }; Process.Start(terminalStartInfo);