Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Added shortcut to open folders in terminal #11192

Merged
merged 2 commits into from Feb 6, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/Files.App/Views/ColumnShellPage.xaml.cs
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down
9 changes: 8 additions & 1 deletion src/Files.App/Views/ModernShellPage.xaml.cs
Expand Up @@ -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;
Expand Down Expand Up @@ -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",
yaira2 marked this conversation as resolved.
Show resolved Hide resolved
WorkingDirectory = path
};
Process.Start(terminalStartInfo);

break;

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