diff --git a/demos/helpers.sh b/demos/helpers.sh index 3a35123a9..a6d9870e5 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_scripts.sh b/demos/run_scripts.sh index 7c7538b61..5bf8c9313 100755 --- a/demos/run_scripts.sh +++ b/demos/run_scripts.sh @@ -25,6 +25,15 @@ which convert > /dev/null \ echo "jj --version: (set PATH to change)" jj --version +# Make `jj` wrap text as opposed to `term-transcript`. `term-transcript` wraps +# at 80 columns. Also, 80 seems to be the maximum number of columns that's +# somewhat readable on mobile devices. +# +# Note that `bash` likes to reset the value of $COLUMNS, so we use a different +# variable here that is interpreted by `run_command()` in `helpers.sh`. +RUN_COMMAND_COLUMNS=80 +export RUN_COMMAND_COLUMNS + run_script_through_term_transcript_and_pipe_result_to_stderr() { script="$1" script_base="${script%.sh}" diff --git a/demos/setup_standard_config.sh b/demos/setup_standard_config.sh index 59ae2f13b..e9022d8c4 100644 --- a/demos/setup_standard_config.sh +++ b/demos/setup_standard_config.sh @@ -17,6 +17,7 @@ username = "jjfan" [ui] color="always" paginate="never" +log-word-wrap=true # Need to set COLUMNS for this to work EOF GIT_CONFIG_GLOBAL=$(mktemp --tmpdir gitconfig-XXXX)