mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-18 18:27:38 +00:00
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:
parent
926c117955
commit
5e697dc1f3
3 changed files with 13 additions and 1 deletions
|
@ -11,7 +11,9 @@ new_tmp_dir() {
|
||||||
|
|
||||||
run_command() {
|
run_command() {
|
||||||
echo "\$ $@"
|
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() {
|
run_command_allow_broken_pipe() {
|
||||||
|
|
|
@ -25,6 +25,15 @@ which convert > /dev/null \
|
||||||
echo "jj --version: (set PATH to change)"
|
echo "jj --version: (set PATH to change)"
|
||||||
jj --version
|
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() {
|
run_script_through_term_transcript_and_pipe_result_to_stderr() {
|
||||||
script="$1"
|
script="$1"
|
||||||
script_base="${script%.sh}"
|
script_base="${script%.sh}"
|
||||||
|
|
|
@ -17,6 +17,7 @@ username = "jjfan"
|
||||||
[ui]
|
[ui]
|
||||||
color="always"
|
color="always"
|
||||||
paginate="never"
|
paginate="never"
|
||||||
|
log-word-wrap=true # Need to set COLUMNS for this to work
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
GIT_CONFIG_GLOBAL=$(mktemp --tmpdir gitconfig-XXXX)
|
GIT_CONFIG_GLOBAL=$(mktemp --tmpdir gitconfig-XXXX)
|
||||||
|
|
Loading…
Reference in a new issue