Quick command implementation (#472)
* Separating "SSH Info" and "Quick Launch", and updating translations. * Adding "Quick Launch" to menu. * Auto-complete, initial version. * Builds, but not finished. * Improved, but there are still some bugs... * Minor changes. * Refactroing request/response identifiers. * Improving command history. * Minor refactoring. * Deleting history by using "Del" key. * Handling mosh special case in quick commands. * SSH command handled as any other command in the path. * New resource strings. * Fixing quick command links. * Fixing after-merging bugs. * Improving filtering. * Finishing filtering. * Changing placeholder text. * Minor refactoring. * Updating resources. * Renaming NewRemoteTab back to NewSshTab.
This commit is contained in:
1 parent
93e52f3209
commit
e88fb78e9d
61 files changed
+2100
-706
No files matched your search
@@ -48,12 +48,14 @@ namespace FluentTerminal.App.ViewModels
|
||||
_keyboardCommandService = keyboardCommandService;
|
||||
_keyboardCommandService.RegisterCommandHandler(nameof(Command.NewTab), async () => await AddLocalTabAsync());
|
||||
_keyboardCommandService.RegisterCommandHandler(nameof(Command.NewSshTab), async () => await AddSshTabAsync());
|
||||
_keyboardCommandService.RegisterCommandHandler(nameof(Command.NewCustomCommandTab), async () => await AddCustomCommandTabAsync());
|
||||
_keyboardCommandService.RegisterCommandHandler(nameof(Command.ConfigurableNewTab), async () => await AddConfigurableTerminal());
|
||||
_keyboardCommandService.RegisterCommandHandler(nameof(Command.ChangeTabTitle), async () => await SelectedTerminal.EditTitle());
|
||||
_keyboardCommandService.RegisterCommandHandler(nameof(Command.CloseTab), CloseCurrentTab);
|
||||
_keyboardCommandService.RegisterCommandHandler(nameof(Command.SavedSshNewTab), async () => await AddSavedSshTerminalAsync());
|
||||
_keyboardCommandService.RegisterCommandHandler(nameof(Command.SavedSshNewWindow), () => NewWindow(NewWindowAction.ShowSshProfileSelection));
|
||||
_keyboardCommandService.RegisterCommandHandler(nameof(Command.NewSshWindow), () => NewWindow(NewWindowAction.ShowSshInfoDialog));
|
||||
_keyboardCommandService.RegisterCommandHandler(nameof(Command.NewCustomCommandWindow), () => NewWindow(NewWindowAction.ShowCustomCommandDialog));
|
||||
|
||||
// Add all of the commands for switching to a tab of a given ID, if there's one open there
|
||||
for (int i = 0; i < 9; i++)
|
||||
@@ -93,6 +95,7 @@ namespace FluentTerminal.App.ViewModels
|
||||
|
||||
AddLocalShellCommand = new RelayCommand(async () => await AddLocalTabAsync());
|
||||
AddSshShellCommand = new RelayCommand(async () => await AddSshTabAsync());
|
||||
AddQuickShellCommand = new RelayCommand(async () => await AddCustomCommandTabAsync());
|
||||
ShowAboutCommand = new RelayCommand(ShowAbout);
|
||||
ShowSettingsCommand = new RelayCommand(ShowSettings);
|
||||
|
||||
@@ -155,6 +158,7 @@ namespace FluentTerminal.App.ViewModels
|
||||
|
||||
public RelayCommand AddLocalShellCommand { get; }
|
||||
public RelayCommand AddSshShellCommand { get; }
|
||||
public RelayCommand AddQuickShellCommand { get; }
|
||||
|
||||
public string WindowTitle
|
||||
{
|
||||
@@ -266,6 +270,23 @@ namespace FluentTerminal.App.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public async Task AddCustomCommandTabAsync()
|
||||
{
|
||||
var profile = await _dialogService.ShowCustomCommandDialogAsync();
|
||||
if (profile == null)
|
||||
{
|
||||
// User selected "Cancel"
|
||||
if (Terminals.Count == 0)
|
||||
{
|
||||
await ApplicationView.TryClose();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
await AddTerminalAsync(profile);
|
||||
}
|
||||
}
|
||||
|
||||
public Task AddSshTabOrWindowAsync(Guid shellProfileId)
|
||||
{
|
||||
switch (_applicationSettings.NewTerminalLocation)
|
||||
|
||||
Reference in new issue
Block a user