ok/jj
1
0
Fork 0
forked from mirrors/jj

demos: make jj perform the line wrapping instead of term-transcript

Previously, `jj` couldn't determine the terminal widths inside demos.
This commit is contained in:
Ilya Grigoriev 2023-08-28 20:57:26 -07:00
parent 926c117955
commit 5e697dc1f3
3 changed files with 13 additions and 1 deletions

View file

@ -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() {

View file

@ -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}"

View file

@ -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)