mirror of
https://onedev.site.tesses.net/crosslang/crosslangdevstudio
synced 2026-02-08 09:15:45 +00:00
Add alacritty
This commit is contained in:
@@ -229,6 +229,7 @@ class CrossLangShell
|
|||||||
}
|
}
|
||||||
if (OperatingSystem.IsLinux() || OperatingSystem.IsFreeBSD())
|
if (OperatingSystem.IsLinux() || OperatingSystem.IsFreeBSD())
|
||||||
{
|
{
|
||||||
|
string alacritty = GetRealPath("alacritty");
|
||||||
string konsole = GetRealPath("konsole");
|
string konsole = GetRealPath("konsole");
|
||||||
string gnome_terminal = GetRealPath("gnome-terminal");
|
string gnome_terminal = GetRealPath("gnome-terminal");
|
||||||
string mate_terminal = GetRealPath("mate-terminal");
|
string mate_terminal = GetRealPath("mate-terminal");
|
||||||
@@ -237,7 +238,26 @@ class CrossLangShell
|
|||||||
string xfce_terminal = GetRealPath("xfce4-terminal");
|
string xfce_terminal = GetRealPath("xfce4-terminal");
|
||||||
|
|
||||||
string xterm = GetRealPath("xterm");
|
string xterm = GetRealPath("xterm");
|
||||||
if (File.Exists(konsole))
|
if (File.Exists(alacritty))
|
||||||
|
{
|
||||||
|
using Process process = new Process();
|
||||||
|
process.StartInfo.WorkingDirectory = workingDirectory;
|
||||||
|
process.StartInfo.FileName = alacritty;
|
||||||
|
process.StartInfo.UseShellExecute = false;
|
||||||
|
if (commandName.Length != 0)
|
||||||
|
{
|
||||||
|
if (keepOpen)
|
||||||
|
process.StartInfo.ArgumentList.Add("--hold");
|
||||||
|
process.StartInfo.ArgumentList.Add("-e");
|
||||||
|
process.StartInfo.ArgumentList.Add(commandName);
|
||||||
|
foreach (var arg in args)
|
||||||
|
{
|
||||||
|
process.StartInfo.ArgumentList.Add(arg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
process.Start();
|
||||||
|
}
|
||||||
|
else if (File.Exists(konsole))
|
||||||
{
|
{
|
||||||
using Process process = new Process();
|
using Process process = new Process();
|
||||||
process.StartInfo.WorkingDirectory = workingDirectory;
|
process.StartInfo.WorkingDirectory = workingDirectory;
|
||||||
|
|||||||
@@ -80,8 +80,23 @@ public partial class FileEditorViewModel : ViewModelBase, ISavable
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
//AssetLoader.Open(new Uri("avares://CrossLangDevStudio/Assets/crosslang.png")
|
//AssetLoader.Open(new Uri("avares://CrossLangDevStudio/Assets/crosslang.png")
|
||||||
|
if (Path.GetFileNameWithoutExtension(path).ToLower() == "dockerfile")
|
||||||
|
{
|
||||||
|
|
||||||
|
_textMateInstallation.SetGrammarFile(_registryOptions.GetScopeByLanguageId("dockerfile"));
|
||||||
|
//_textMateInstallation.SetGrammar(_registryOptions.GetScopeByLanguageId(.Id));
|
||||||
|
}
|
||||||
|
if (Path.GetFileNameWithoutExtension(path).ToLower() == "makefile")
|
||||||
|
{
|
||||||
|
|
||||||
|
_textMateInstallation.SetGrammarFile(_registryOptions.GetScopeByLanguageId("makefile"));
|
||||||
|
//_textMateInstallation.SetGrammar(_registryOptions.GetScopeByLanguageId(.Id));
|
||||||
|
}
|
||||||
|
else if (Path.GetFileNameWithoutExtension(path) == "docker-compose" && (ext == ".yml" || ext == ".yaml"))
|
||||||
|
_textMateInstallation.SetGrammarFile(_registryOptions.GetScopeByLanguageId("dockercompose"));
|
||||||
|
else
|
||||||
|
_textMateInstallation.SetGrammar(_registryOptions.GetScopeByLanguageId(_registryOptions.GetLanguageByExtension(ext).Id));
|
||||||
|
|
||||||
_textMateInstallation.SetGrammar(_registryOptions.GetScopeByLanguageId(_registryOptions.GetLanguageByExtension(ext).Id));
|
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -556,7 +556,7 @@ public partial class MainWindowViewModel : ViewModelBase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static string[] FILE_EXTS = new string[]{
|
static string[] FILE_EXTS = {
|
||||||
".tcross",
|
".tcross",
|
||||||
".json",
|
".json",
|
||||||
".txt",
|
".txt",
|
||||||
@@ -575,18 +575,37 @@ public partial class MainWindowViewModel : ViewModelBase
|
|||||||
".ts",
|
".ts",
|
||||||
".tsx",
|
".tsx",
|
||||||
".gitignore",
|
".gitignore",
|
||||||
".svg"
|
".svg",
|
||||||
|
".md",
|
||||||
|
".yaml",
|
||||||
|
".yml",
|
||||||
|
".toml",
|
||||||
|
".tcasm",
|
||||||
|
".dart",
|
||||||
|
".bat",
|
||||||
|
".sh",
|
||||||
|
".lua",
|
||||||
|
".java",
|
||||||
|
".ini",
|
||||||
|
".go",
|
||||||
|
".crossarchiveignore"
|
||||||
};
|
};
|
||||||
|
|
||||||
public void OpenFile(string path)
|
public void OpenFile(string path)
|
||||||
{
|
{
|
||||||
bool isValid = false;
|
bool isValid = false;
|
||||||
string ext = Path.GetExtension(path).ToLower();
|
string ext = Path.GetExtension(path).ToLower();
|
||||||
|
|
||||||
foreach (var item in FILE_EXTS)
|
foreach (var item in FILE_EXTS)
|
||||||
{
|
{
|
||||||
if (ext == item)
|
if (ext == item)
|
||||||
isValid = true;
|
isValid = true;
|
||||||
}
|
}
|
||||||
|
if (Path.GetFileNameWithoutExtension(path).ToLower() == "dockerfile")
|
||||||
|
isValid = true;
|
||||||
|
if (Path.GetFileNameWithoutExtension(path).ToLower() == "makefile")
|
||||||
|
isValid = true;
|
||||||
|
|
||||||
if (!isValid)
|
if (!isValid)
|
||||||
{
|
{
|
||||||
OpenOtherFile(path, ext);
|
OpenOtherFile(path, ext);
|
||||||
|
|||||||
Reference in New Issue
Block a user