diff --git a/demos/helpers.sh b/demos/helpers.sh index f6a83a7567..cdc2ceeb5e 100644 --- a/demos/helpers.sh +++ b/demos/helpers.sh @@ -11,7 +11,9 @@ new_tmp_dir() { run_command() { echo "\$ $@" - eval "$@" + # `bash` often resets $COLUMNS, so we also + # allow $RUN_COMMAND_COLUMNS + COLUMNS=${RUN_COMMAND_COLUMNS-${COLUMNS-80}} eval "$@" } run_command_allow_broken_pipe() { diff --git a/demos/run_script.sh b/demos/run_script.sh index c7d0d79990..dc621d7f0e 100755 --- a/demos/run_script.sh +++ b/demos/run_script.sh @@ -16,6 +16,16 @@ GIT_CONFIG_GLOBAL=$(mktemp --tmpdir gitconfig-XXXX) export GIT_CONFIG_GLOBAL git_config "$GIT_CONFIG_GLOBAL" +# Make `jj` wrap text as opposed to `term-transcript` +# Currently, 80 is the only value the tool supports when +# used as a CLI. +# https://github.com/slowli/term-transcript/issues/59 +# +# Note that `bash` likes to reset the value of $COLUMNS, +# so we need to use a different variable here. +RUN_COMMAND_COLUMNS=80 +export RUN_COMMAND_COLUMNS + for script in "$@"; do script_base="${script%.sh}" script_base="${script_base#demo_}"