Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ef7f909d26 | ||
|
|
f2618fa940 | ||
|
|
363f885aea | ||
|
|
ed4a5adb16 | ||
|
|
82a3532e90 | ||
|
|
15d713191c | ||
|
|
575022139a | ||
|
|
b9686ac4ec |
No files matched your search
@@ -1,3 +1,3 @@
|
||||
reg add "HKCU\Software\Classes\Directory\shell\Open Fluent Terminal here\command" /d "\"%LOCALAPPDATA%\Microsoft\WindowsApps\flute.exe\" new %%1" /f
|
||||
reg add "HKCU\Software\Classes\Directory\Background\shell\Open Fluent Terminal here\command" /d "\"%LOCALAPPDATA%\Microsoft\WindowsApps\flute.exe\" new %%V" /f
|
||||
reg add "HKCU\Software\Classes\LibraryFolder\Background\shell\Open Fluent Terminal here\command" /d "\"%LOCALAPPDATA%\Microsoft\WindowsApps\flute.exe\" new %%V" /f
|
||||
reg add "HKCU\Software\Classes\Directory\shell\Open Fluent Terminal here\command" /d "\"%LOCALAPPDATA%\Microsoft\WindowsApps\flute.exe\" new \"%%1\"" /f
|
||||
reg add "HKCU\Software\Classes\Directory\Background\shell\Open Fluent Terminal here\command" /d "\"%LOCALAPPDATA%\Microsoft\WindowsApps\flute.exe\" new \"%%V\"" /f
|
||||
reg add "HKCU\Software\Classes\LibraryFolder\Background\shell\Open Fluent Terminal here\command" /d "\"%LOCALAPPDATA%\Microsoft\WindowsApps\flute.exe\" new \"%%V\"" /f
|
||||
@@ -92,5 +92,18 @@ namespace FluentTerminal.App.Services.Test
|
||||
|
||||
shellProfileSelectionDialog.Verify(x => x.SelectProfile(), Times.Once);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ShowInputDialogAsync_UsesIInputDialogSetTitle()
|
||||
{
|
||||
var title = "title";
|
||||
var inputDialog = new Mock<IInputDialog>();
|
||||
var dialogService = new DialogService(Mock.Of<IShellProfileSelectionDialog>, Mock.Of<IMessageDialog>, Mock.Of<ICreateKeyBindingDialog>, () => inputDialog.Object);
|
||||
|
||||
dialogService.ShowInputDialogAsync(title);
|
||||
|
||||
inputDialog.Verify(x => x.SetTitle(title), Times.Once);
|
||||
inputDialog.Verify(x => x.GetInput(), Times.Once);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using FluentTerminal.Models;
|
||||
using FluentTerminal.Models.Enums;
|
||||
using FluentTerminal.Models.Responses;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@@ -114,7 +115,7 @@ namespace FluentTerminal.App.Services
|
||||
/// <param name="shellProfile"></param>
|
||||
/// <param name="size"></param>
|
||||
/// <param name="sessionType"></param>
|
||||
public async Task StartShellProcess(ShellProfile shellProfile, TerminalSize size, SessionType sessionType)
|
||||
public async Task<CreateTerminalResponse> StartShellProcess(ShellProfile shellProfile, TerminalSize size, SessionType sessionType)
|
||||
{
|
||||
_trayProcessCommunicationService.SubscribeForTerminalOutput(Id, t => OutputReceived?.Invoke(this, t));
|
||||
var response = await _trayProcessCommunicationService.CreateTerminal(Id, size, shellProfile, sessionType).ConfigureAwait(true);
|
||||
@@ -124,11 +125,20 @@ namespace FluentTerminal.App.Services
|
||||
FallbackTitle = response.ShellExecutableName;
|
||||
SetTitle(FallbackTitle);
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
public Task Write(byte[] data)
|
||||
{
|
||||
return _trayProcessCommunicationService.Write(Id, data);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tells the ViewModel that this view failed to launch and can be closed.
|
||||
/// </summary>
|
||||
public void ReportLauchFailed()
|
||||
{
|
||||
Closed?.Invoke(this, System.EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,6 @@ namespace FluentTerminal.App.ViewModels
|
||||
private string _workingDirectory;
|
||||
private readonly IApplicationView _applicationView;
|
||||
private readonly IDefaultValueProvider _defaultValueProvider;
|
||||
private bool _editingLineEndingStyle;
|
||||
|
||||
public ShellProfileViewModel(ShellProfile shellProfile, ISettingsService settingsService, IDialogService dialogService, IFileSystemService fileSystemService, IApplicationView applicationView, IDefaultValueProvider defaultValueProvider, Boolean isNew)
|
||||
{
|
||||
@@ -200,37 +199,31 @@ namespace FluentTerminal.App.ViewModels
|
||||
public LineEndingStyle LineEndingStyle
|
||||
{
|
||||
get => _lineEndingStyle;
|
||||
set
|
||||
{
|
||||
if (_lineEndingStyle != value && !_editingLineEndingStyle)
|
||||
{
|
||||
_editingLineEndingStyle = true;
|
||||
_lineEndingStyle = value;
|
||||
RaisePropertyChanged();
|
||||
RaisePropertyChanged(nameof(DoNotModifyIsSelected));
|
||||
RaisePropertyChanged(nameof(ToCRLFIsSelected));
|
||||
RaisePropertyChanged(nameof(ToLFIsSelected));
|
||||
_editingLineEndingStyle = false;
|
||||
}
|
||||
}
|
||||
set => Set(ref _lineEndingStyle, value);
|
||||
}
|
||||
|
||||
public bool DoNotModifyIsSelected
|
||||
{
|
||||
get => LineEndingStyle == LineEndingStyle.DoNotModify;
|
||||
set => LineEndingStyle = LineEndingStyle.DoNotModify;
|
||||
set { if (value) LineEndingStyle = LineEndingStyle.DoNotModify; }
|
||||
}
|
||||
|
||||
public bool ToCRLFIsSelected
|
||||
{
|
||||
get => LineEndingStyle == LineEndingStyle.ToCRLF;
|
||||
set => LineEndingStyle = LineEndingStyle.ToCRLF;
|
||||
set { if (value) LineEndingStyle = LineEndingStyle.ToCRLF; }
|
||||
}
|
||||
|
||||
public bool ToLFIsSelected
|
||||
{
|
||||
get => LineEndingStyle == LineEndingStyle.ToLF;
|
||||
set => LineEndingStyle = LineEndingStyle.ToLF;
|
||||
set { if (value) LineEndingStyle = LineEndingStyle.ToLF; }
|
||||
}
|
||||
|
||||
public bool ToCRIsSelected
|
||||
{
|
||||
get => LineEndingStyle == LineEndingStyle.ToCR;
|
||||
set { if (value) LineEndingStyle = LineEndingStyle.ToCR; }
|
||||
}
|
||||
|
||||
public void SaveChanges()
|
||||
@@ -363,6 +356,7 @@ namespace FluentTerminal.App.ViewModels
|
||||
_fallbackProfile = new ShellProfile
|
||||
{
|
||||
Arguments = Model.Arguments,
|
||||
LineEndingTranslation = Model.LineEndingTranslation,
|
||||
Location = Model.Location,
|
||||
Name = Model.Name,
|
||||
WorkingDirectory = Model.WorkingDirectory,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10" IgnorableNamespaces="uap mp desktop rescap">
|
||||
<Identity Name="53621FSApps.FluentTerminal" Publisher="CN=BDC72197-B634-438A-B863-16DCB7D90C85" Version="0.4.0.0" />
|
||||
<Identity Name="53621FSApps.FluentTerminal" Publisher="CN=BDC72197-B634-438A-B863-16DCB7D90C85" Version="0.4.1.0" />
|
||||
<mp:PhoneIdentity PhoneProductId="f7225014-f405-4342-ad2e-ebf6ac60ea2c" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
|
||||
<Properties>
|
||||
<DisplayName>Fluent Terminal</DisplayName>
|
||||
|
||||
@@ -292,6 +292,10 @@
|
||||
Content="Convert line endings to CR+LF"
|
||||
GroupName="LineEndingStyle"
|
||||
IsChecked="{x:Bind ToCRLFIsSelected, Mode=TwoWay}" />
|
||||
<RadioButton
|
||||
Content="Convert line endings to CR"
|
||||
GroupName="LineEndingStyle"
|
||||
IsChecked="{x:Bind ToCRIsSelected, Mode=TwoWay}" />
|
||||
<RadioButton
|
||||
Content="Convert line endings to LF"
|
||||
GroupName="LineEndingStyle"
|
||||
|
||||
@@ -142,7 +142,13 @@ namespace FluentTerminal.App.Views
|
||||
var port = await ViewModel.TrayProcessCommunicationService.GetAvailablePort().ConfigureAwait(true);
|
||||
await CreateWebSocketServer(port.Port).ConfigureAwait(true);
|
||||
_connectedEvent.Wait();
|
||||
await ViewModel.Terminal.StartShellProcess(ViewModel.ShellProfile, size, sessionType).ConfigureAwait(true);
|
||||
var response = await ViewModel.Terminal.StartShellProcess(ViewModel.ShellProfile, size, sessionType).ConfigureAwait(true);
|
||||
if (!response.Success)
|
||||
{
|
||||
await ViewModel.DialogService.ShowMessageDialogAsnyc("Error", response.Error, DialogButton.OK).ConfigureAwait(true);
|
||||
ViewModel.Terminal.ReportLauchFailed();
|
||||
return;
|
||||
}
|
||||
_webView.Focus(FocusState.Programmatic);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import * as Terminal from '../node_modules/xterm/dist/xterm';
|
||||
import * as attach from '../node_modules/xterm/dist/addons/attach/attach';
|
||||
import * as fit from '../node_modules/xterm/dist/addons/fit/fit';
|
||||
import * as winptyCompat from '../node_modules/xterm/dist/addons/winptyCompat/winptyCompat';
|
||||
import * as search from '../node_modules/xterm/dist/addons/search/search';
|
||||
|
||||
import { Terminal } from "xterm";
|
||||
import * as attach from "xterm/lib/addons/attach/attach";
|
||||
import * as fit from "xterm/lib/addons/fit/fit";
|
||||
import * as winptyCompat from "xterm/lib/addons/winptyCompat/winptyCompat";
|
||||
import * as search from "xterm/lib/addons/search/search";
|
||||
|
||||
Terminal.applyAddon(attach);
|
||||
Terminal.applyAddon(fit);
|
||||
|
||||
@@ -7,6 +7,9 @@ namespace FluentTerminal.Models.Enums
|
||||
[Description("Do not modify")]
|
||||
DoNotModify,
|
||||
|
||||
[Description("Convert to CR")]
|
||||
ToCR,
|
||||
|
||||
[Description("Convert to CRLF")]
|
||||
ToCRLF,
|
||||
|
||||
|
||||
@@ -45,6 +45,8 @@ namespace FluentTerminal.Models
|
||||
{
|
||||
switch (LineEndingTranslation)
|
||||
{
|
||||
case LineEndingStyle.ToCR:
|
||||
return NewlinePattern.Replace(content, "\r");
|
||||
case LineEndingStyle.ToCRLF:
|
||||
return NewlinePattern.Replace(content, "\r\n");
|
||||
case LineEndingStyle.ToLF:
|
||||
|
||||
@@ -108,9 +108,9 @@ namespace FluentTerminal.SystemTray.Services
|
||||
public string GetDefaultEnvironmentVariableString()
|
||||
{
|
||||
var environmentVariables = Environment.GetEnvironmentVariables();
|
||||
environmentVariables.Add("TERM", "xterm-256color");
|
||||
environmentVariables.Add("TERM_PROGRAM", "FluentTerminal");
|
||||
environmentVariables.Add("TERM_PROGRAM_VERSION", $"{Package.Current.Id.Version.Major}.{Package.Current.Id.Version.Minor}.{Package.Current.Id.Version.Build}.{Package.Current.Id.Version.Revision}");
|
||||
environmentVariables["TERM"] = "xterm-256color";
|
||||
environmentVariables["TERM_PROGRAM"] = "FluentTerminal";
|
||||
environmentVariables["TERM_PROGRAM_VERSION"] = $"{Package.Current.Id.Version.Major}.{Package.Current.Id.Version.Minor}.{Package.Current.Id.Version.Build}.{Package.Current.Id.Version.Revision}";
|
||||
|
||||
var builder = new StringBuilder();
|
||||
|
||||
|
||||
+3
-3
@@ -497,19 +497,19 @@ function InstallContextMenuIntegration
|
||||
-RegistryPath "hkcu:\Software\Classes\Directory\shell\Open Fluent Terminal here\command"`
|
||||
-Name "(Default)"`
|
||||
-Type "ExpandString"`
|
||||
-Value "`"%LOCALAPPDATA%\Microsoft\WindowsApps\flute.exe`" new %1"
|
||||
-Value "`"%LOCALAPPDATA%\Microsoft\WindowsApps\flute.exe`" new `"%1`""
|
||||
|
||||
ForceAddRegKeyValue `
|
||||
-RegistryPath "hkcu:\Software\Classes\Directory\Background\shell\Open Fluent Terminal here\command"`
|
||||
-Name "(Default)"`
|
||||
-Type "ExpandString"`
|
||||
-Value "`"%LOCALAPPDATA%\Microsoft\WindowsApps\flute.exe`" new %V"
|
||||
-Value "`"%LOCALAPPDATA%\Microsoft\WindowsApps\flute.exe`" new `"%V`""
|
||||
|
||||
ForceAddRegKeyValue `
|
||||
-RegistryPath "hkcu:\Software\Classes\Directory\LibraryFolder\shell\Open Fluent Terminal here\command"`
|
||||
-Name "(Default)"`
|
||||
-Type "ExpandString"`
|
||||
-Value "`"%LOCALAPPDATA%\Microsoft\WindowsApps\flute.exe`" new %V"
|
||||
-Value "`"%LOCALAPPDATA%\Microsoft\WindowsApps\flute.exe`" new `"%V`""
|
||||
}
|
||||
|
||||
#
|
||||
|
||||
Reference in new issue
Block a user