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 <anerruption@disroot.org>
Co-authored-by: hynak <hynak@noreply.codeberg.org>
Co-committed-by: hynak <hynak@noreply.codeberg.org>
This commit is contained in:
hynak
2026-02-10 22:20:30 +01:00
committed by AnErrupTion
parent d268d5bb45
commit 4a72e41e44
2 changed files with 24 additions and 22 deletions

44
res/startup.sh Normal file → Executable file
View File

@@ -7,32 +7,34 @@
# Colors are in red/green/blue hex (the current colors are a brighter palette than default) # Colors are in red/green/blue hex (the current colors are a brighter palette than default)
# #
#if [ "$TERM" = "linux" ]; then #if [ "$TERM" = "linux" ]; then
# declare -a colors=( # BLACK="232323"
# [0]="232323" # black # DARK_RED="D75F5F"
# [1]="D75F5F" # dark red # DARK_GREEN="87AF5F"
# [2]="87AF5F" # dark green # DARK_YELLOW="D7AF87"
# [3]="D7AF87" # dark yellow # DARK_BLUE="8787AF"
# [4]="8787AF" # dark blue # DARK_MAGENTA="BD53A5"
# [5]="BD53A5" # dark magenta # DARK_CYAN="5FAFAF"
# [6]="5FAFAF" # dark cyan # LIGHT_GRAY="E5E5E5"
# [7]="E5E5E5" # light gray # DARK_GRAY="2B2B2B"
# [8]="2B2B2B" # dark gray # RED="E33636"
# [9]="E33636" # red # GREEN="98E34D"
# [10]="98E34D" # green # YELLOW="FFD75F"
# [11]="FFD75F" # yellow # BLUE="7373C9"
# [12]="7373C9" # blue # MAGENTA="D633B2"
# [13]="D633B2" # magenta # CYAN="44C9C9"
# [14]="44C9C9" # cyan # WHITE="FFFFFF"
# [15]="FFFFFF" # white #
# ) # 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" # control_palette_str="\e]P"
# #
# for i in ${!colors[@]} # i=0
# while [ $i -lt 16 ]
# do # 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 # done
# #
# clear # for fixing background artifacting after changing color # clear # for fixing background artifacting after changing color
#fi #fi

View File

@@ -312,7 +312,7 @@ pub fn main() !void {
if (state.config.start_cmd) |start_cmd| { if (state.config.start_cmd) |start_cmd| {
var start = std.process.Child.init(&[_][]const u8{ "/bin/sh", "-c", start_cmd }, state.allocator); 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; start.stderr_behavior = .Ignore;
handle_start_cmd: { handle_start_cmd: {