From 4a72e41e44624f0f2d4a147f67e22dfed3e34b79 Mon Sep 17 00:00:00 2001 From: hynak Date: Tue, 10 Feb 2026 22:20:30 +0100 Subject: [PATCH] Fix default startup script (#929) ## What are the changes about? Discussed in !920. Adds fixes to the startup script by removing the array usage (some shells use arrays different/unsupported) and adds stdout_behavior Inherit flag to the child process to propagate the echos to the TTY. ## What existing issue does this resolve? N/A ## Pre-requisites - [x] I have tested & confirmed the changes work locally Reviewed-on: https://codeberg.org/fairyglade/ly/pulls/929 Reviewed-by: AnErrupTion Co-authored-by: hynak Co-committed-by: hynak --- res/startup.sh | 44 +++++++++++++++++++++++--------------------- src/main.zig | 2 +- 2 files changed, 24 insertions(+), 22 deletions(-) mode change 100644 => 100755 res/startup.sh diff --git a/res/startup.sh b/res/startup.sh old mode 100644 new mode 100755 index 6685403..2297e2e --- a/res/startup.sh +++ b/res/startup.sh @@ -7,32 +7,34 @@ # Colors are in red/green/blue hex (the current colors are a brighter palette than default) # #if [ "$TERM" = "linux" ]; then -# declare -a colors=( -# [0]="232323" # black -# [1]="D75F5F" # dark red -# [2]="87AF5F" # dark green -# [3]="D7AF87" # dark yellow -# [4]="8787AF" # dark blue -# [5]="BD53A5" # dark magenta -# [6]="5FAFAF" # dark cyan -# [7]="E5E5E5" # light gray -# [8]="2B2B2B" # dark gray -# [9]="E33636" # red -# [10]="98E34D" # green -# [11]="FFD75F" # yellow -# [12]="7373C9" # blue -# [13]="D633B2" # magenta -# [14]="44C9C9" # cyan -# [15]="FFFFFF" # white -# ) +# BLACK="232323" +# DARK_RED="D75F5F" +# DARK_GREEN="87AF5F" +# DARK_YELLOW="D7AF87" +# DARK_BLUE="8787AF" +# DARK_MAGENTA="BD53A5" +# DARK_CYAN="5FAFAF" +# LIGHT_GRAY="E5E5E5" +# DARK_GRAY="2B2B2B" +# RED="E33636" +# GREEN="98E34D" +# YELLOW="FFD75F" +# BLUE="7373C9" +# MAGENTA="D633B2" +# CYAN="44C9C9" +# WHITE="FFFFFF" +# +# COLORS="${BLACK} ${DARK_RED} ${DARK_GREEN} ${DARK_YELLOW} ${DARK_BLUE} ${DARK_MAGENTA} ${DARK_CYAN} ${LIGHT_GRAY} ${DARK_GRAY} ${RED} ${GREEN} ${YELLOW} ${BLUE} ${MAGENTA} ${CYAN} ${WHITE}" # # control_palette_str="\e]P" # -# for i in ${!colors[@]} +# i=0 +# while [ $i -lt 16 ] # do -# echo -en "${control_palette_str}$( printf "%x" ${i} )${colors[i]}" +# echo -en "${control_palette_str}$( printf "%x" ${i} )$(echo $COLORS | cut -d ' ' -f`expr $i + 1`)" +# +# i=`expr $i + 1` # done # # clear # for fixing background artifacting after changing color #fi - diff --git a/src/main.zig b/src/main.zig index 9e9113f..832b3af 100644 --- a/src/main.zig +++ b/src/main.zig @@ -312,7 +312,7 @@ pub fn main() !void { if (state.config.start_cmd) |start_cmd| { var start = std.process.Child.init(&[_][]const u8{ "/bin/sh", "-c", start_cmd }, state.allocator); - start.stdout_behavior = .Ignore; + start.stdout_behavior = .Inherit; start.stderr_behavior = .Ignore; handle_start_cmd: {