Skip to content

Commit

Permalink
enter: pipe both stdout and stderr to fifo, Fix #610
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Di Maio <[email protected]>
  • Loading branch information
89luca89 committed Feb 16, 2024
1 parent d1a0f5c commit fea7a84
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions distrobox-enter
Original file line number Diff line number Diff line change
Expand Up @@ -570,13 +570,16 @@ if [ "${container_status}" != "running" ]; then
fi
# save starting loop timestamp in temp variable, we'll use it
# after to let logs command minimize possible holes
${container_manager} logs --since "${log_timestamp}" -f "${container_name}" 2> /dev/null \
> "${app_cache_dir}/.${container_name}.fifo" &
${container_manager} logs --since "${log_timestamp}" -f "${container_name}" \
> "${app_cache_dir}/.${container_name}.fifo" 2>&1 &
logs_pid="$!"

# read logs from log_timestamp to now, line by line
while IFS= read -r line; do
case "${line}" in
*"printf"*)
# Ignoring logging commands
;;
*"Error:"*)
printf >&2 "\033[31m %s\n\033[0m" "${line}"
exit 1
Expand Down

0 comments on commit fea7a84

Please sign in to comment.