diff --git a/bin/miaou-bash b/bin/miaou-bash index 4025d64..7918878 100755 --- a/bin/miaou-bash +++ b/bin/miaou-bash @@ -207,16 +207,15 @@ function ansi_block_continuation { function ansi_block_error { FG=BLACK BG=RED - PADDING=2 local content detail exit_code content=$(style_ansi "$1") - content=$(style_padding "$content") + content=$(PADDING=2 style_padding "$content") detail="$2" - [[ -n "$detail" ]] && detail=$(BG=BLACK FG=WHITE PADDING_LEFT=4 style_padding "$2") + [[ -n "$detail" ]] && detail=$(BG=BLACK FG=WHITE PADDING=2 style_padding "$2") - exit_code=$(FG=CYAN style_ansi "$3") + exit_code=$(FG=CYAN PADDING=2 style_padding "$3") builtin echo -en "\r" BLOCK_CONTINUATION_COL=5 style_block "$content$detail$exit_code" ansi_reset diff --git a/test/miaou-bash.test.bash b/test/miaou-bash.test.bash index 098a051..7f04781 100755 --- a/test/miaou-bash.test.bash +++ b/test/miaou-bash.test.bash @@ -51,6 +51,7 @@ fail_type subshell_term SUBSHELL_TERM fail_type unbound_variable UNBOUND_VARIABLE fail_type false FALSE fail_type return RETURN +fail_type command_not_found COMMAND_NOT_FOUND failed=$((TEST_COUNT - SUCCESS_COUNT)) if [[ $failed -gt 0 ]]; then diff --git a/test/stub/scenario.bash b/test/stub/scenario.bash index dd8e1bd..ea5be6f 100755 --- a/test/stub/scenario.bash +++ b/test/stub/scenario.bash @@ -26,6 +26,11 @@ function do_last_false { function do_return { echo START return 99 +} + +function do_command_not_found { + echo START + command_not_found A B C echo SHOULD NOT APPEAR }