-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProgram.cs
More file actions
36 lines (27 loc) · 903 Bytes
/
Program.cs
File metadata and controls
36 lines (27 loc) · 903 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Claude - claude-opus-4-7
// ted — Terminal.Gui.Editor demo. Menubar + Editor + StatusBar, single-file.
// See Issue #7 and specs/00-plan.md §12 for the planned demo surface.
using Ted;
using Terminal.Gui.App;
using Terminal.Gui.Configuration;
Hosting.ConfigureLogging ();
Hosting.EnableTracing ();
ConfigurationManager.Enable (ConfigLocations.All);
EditorSettings.Load ();
using IApplication app = Application.Create ();
app.Init ();
var readOnly = args.Any (static arg => arg is "--read-only" or "-r");
var requestedPath = args.FirstOrDefault (static arg => arg is not ("--read-only" or "-r"));
using TedApp ted = new (readOnly);
if (!string.IsNullOrWhiteSpace (requestedPath))
{
if (File.Exists (requestedPath))
{
ted.SetDocument (File.ReadAllText (requestedPath), requestedPath);
}
else
{
ted.OpenMissingFile (requestedPath);
}
}
app.Run (ted);