Compare commits

..

No commits in common. "ab3373ab332df8d45fdca45cf18501a261af83ac" and "a1f296ddde410fe31303975ba4a0fc8644aa3df6" have entirely different histories.

3 changed files with 2 additions and 44 deletions

View file

@ -30,7 +30,7 @@
.hash = "fuzzig-0.1.1-Ji0xivxIAQBD0g8O_NV_0foqoPf3elsg9Sc3pNfdVH4D", .hash = "fuzzig-0.1.1-Ji0xivxIAQBD0g8O_NV_0foqoPf3elsg9Sc3pNfdVH4D",
}, },
.vaxis = .{ .vaxis = .{
.url = "git+https://github.com/neurocyte/libvaxis?ref=main#78aff0865f0f6206ece9263dcd9b051352da1e82", .url = "git+https://github.com/neurocyte/libvaxis?ref=main#e9c1111efd98aeb7c2db45d3e31987429fb5f26d",
.hash = "vaxis-0.5.1-BWNV_BkyCQAo2UBeY_gbzP09d4pHDaqtg44snF5k3mh2", .hash = "vaxis-0.5.1-BWNV_BkyCQAo2UBeY_gbzP09d4pHDaqtg44snF5k3mh2",
}, },
.zeit = .{ .zeit = .{

View file

@ -1119,7 +1119,6 @@ fn resolve_executable(executable: [:0]const u8) [:0]const u8 {
} }
fn restart() noreturn { fn restart() noreturn {
if (builtin.os.tag == .windows) return restart_win32();
const executable = resolve_executable(std.mem.span(std.os.argv[0])); const executable = resolve_executable(std.mem.span(std.os.argv[0]));
const argv = [_]?[*:0]const u8{ const argv = [_]?[*:0]const u8{
executable, executable,
@ -1144,40 +1143,6 @@ fn restart_with_sudo() noreturn {
restart_failed(ret); restart_failed(ret);
} }
fn restart_win32() noreturn {
if (!build_options.gui) return restart_manual();
const executable = resolve_executable(std.mem.span(std.os.argv[0]));
const argv = [_][]const u8{
executable,
"--restore-session",
};
const a = std.heap.c_allocator;
var child = std.process.Child.init(&argv, a);
child.stdin_behavior = .Inherit;
child.stdout_behavior = .Inherit;
child.stderr_behavior = .Inherit;
child.spawn() catch {
std.os.windows.kernel32.ExitProcess(1);
};
std.os.windows.kernel32.ExitProcess(0);
}
fn restart_manual() noreturn {
const executable = resolve_executable(std.mem.span(std.os.argv[0]));
var stderr_buffer: [1024]u8 = undefined;
var stderr_writer = std.fs.File.stderr().writer(&stderr_buffer);
stderr_writer.interface.print(
\\
\\ Manual restart required. Run:
\\ > {s} --restore-session
\\ to restart now.
\\
\\
, .{executable}) catch {};
stderr_writer.interface.flush() catch {};
exit(234);
}
fn restart_failed(ret: c_int) noreturn { fn restart_failed(ret: c_int) noreturn {
var stderr_buffer: [1024]u8 = undefined; var stderr_buffer: [1024]u8 = undefined;
var stderr_writer = std.fs.File.stderr().writer(&stderr_buffer); var stderr_writer = std.fs.File.stderr().writer(&stderr_buffer);

View file

@ -1,5 +1,4 @@
const std = @import("std"); const std = @import("std");
const root = @import("root");
const cbor = @import("cbor"); const cbor = @import("cbor");
const log = @import("log"); const log = @import("log");
const Style = @import("theme").Style; const Style = @import("theme").Style;
@ -81,13 +80,7 @@ pub fn init(allocator: std.mem.Allocator, handler_ctx: *anyopaque, no_alternate:
const tty_buffer = try allocator.alloc(u8, 4096); const tty_buffer = try allocator.alloc(u8, 4096);
return .{ return .{
.allocator = allocator, .allocator = allocator,
.tty = vaxis.Tty.init(tty_buffer) catch |e| { .tty = vaxis.Tty.init(tty_buffer) catch return error.TtyInitError,
var stderr_buffer: [1024]u8 = undefined;
var stderr_writer = std.fs.File.stderr().writer(&stderr_buffer);
stderr_writer.interface.print("\n" ++ root.application_name ++ " ERROR: {s}\n", .{@errorName(e)}) catch {};
stderr_writer.interface.flush() catch {};
return error.TtyInitError;
},
.tty_buffer = tty_buffer, .tty_buffer = tty_buffer,
.vx = try vaxis.init(allocator, opts), .vx = try vaxis.init(allocator, opts),
.no_alternate = no_alternate, .no_alternate = no_alternate,