Skip to content

Commit 932c751

Browse files
committed
Stop redirecting X11 output to session log (closes #693, #688)
Signed-off-by: AnErrupTion <[email protected]>
1 parent 4599654 commit 932c751

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

res/config.ini

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,10 @@ save = true
183183
service_name = ly
184184

185185
# Session log file path
186-
# This will contain stdout and stderr of X11 and Wayland sessions
186+
# This will contain stdout and stderr of Wayland sessions
187187
# By default it's saved in the user's home directory
188-
# Note: this file won't be used in a shell session (due to the need of stdout and stderr)
188+
# Important: due to technical limitations, X11 and shell sessions aren't supported, which
189+
# means you won't get any logs from those sessions
189190
session_log = ly-session.log
190191

191192
# Setup command

src/auth.zig

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -375,9 +375,6 @@ fn xauth(display_name: [:0]u8, shell: [*:0]const u8, pw_dir: [*:0]const u8, opti
375375

376376
const pid = try std.posix.fork();
377377
if (pid == 0) {
378-
const log_file = try redirectStandardStreams(options.session_log, true);
379-
defer log_file.close();
380-
381378
var cmd_buffer: [1024]u8 = undefined;
382379
const cmd_str = std.fmt.bufPrintZ(&cmd_buffer, "{s} add {s} . {s}", .{ options.xauth_cmd, display_name, magic_cookie }) catch std.process.exit(1);
383380
const args = [_:null]?[*:0]const u8{ shell, "-c", cmd_str };
@@ -417,7 +414,7 @@ fn executeX11Cmd(shell: [*:0]const u8, pw_dir: [*:0]const u8, options: AuthOptio
417414
const pid = try std.posix.fork();
418415
if (pid == 0) {
419416
var cmd_buffer: [1024]u8 = undefined;
420-
const cmd_str = std.fmt.bufPrintZ(&cmd_buffer, "{s} {s} {s} >{s} 2>&1", .{ options.x_cmd, display_name, vt, options.session_log }) catch std.process.exit(1);
417+
const cmd_str = std.fmt.bufPrintZ(&cmd_buffer, "{s} {s} {s}", .{ options.x_cmd, display_name, vt }) catch std.process.exit(1);
421418
const args = [_:null]?[*:0]const u8{ shell, "-c", cmd_str };
422419
std.posix.execveZ(shell, &args, std.c.environ) catch {};
423420
std.process.exit(1);
@@ -440,7 +437,7 @@ fn executeX11Cmd(shell: [*:0]const u8, pw_dir: [*:0]const u8, options: AuthOptio
440437
xorg_pid = try std.posix.fork();
441438
if (xorg_pid == 0) {
442439
var cmd_buffer: [1024]u8 = undefined;
443-
const cmd_str = std.fmt.bufPrintZ(&cmd_buffer, "{s} {s} {s} >{s} 2>&1", .{ options.setup_cmd, options.login_cmd orelse "", desktop_cmd, options.session_log }) catch std.process.exit(1);
440+
const cmd_str = std.fmt.bufPrintZ(&cmd_buffer, "{s} {s} {s}", .{ options.setup_cmd, options.login_cmd orelse "", desktop_cmd }) catch std.process.exit(1);
444441
const args = [_:null]?[*:0]const u8{ shell, "-c", cmd_str };
445442
std.posix.execveZ(shell, &args, std.c.environ) catch {};
446443
std.process.exit(1);

0 commit comments

Comments
 (0)