Skip to content

Commit

Permalink
demos: fix terminal width for screenshots
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyagr committed Sep 10, 2023
1 parent e846334 commit 644fb32
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 3 additions & 1 deletion demos/helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
10 changes: 10 additions & 0 deletions demos/run_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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_}"
Expand Down

0 comments on commit 644fb32

Please sign in to comment.