git-delete-merged-branches icon indicating copy to clipboard operation
git-delete-merged-branches copied to clipboard

Configuration output is truncated (on macOS)?

Open telemachus opened this issue 1 year ago • 13 comments

On a first run (or later when using --config), the output of configuration text seems truncated on the first step:

$ git-delete-merged-branches-3.10
Configure git-delete-merged-branches for repository 'notes':
een merged to?

In addition, although I have NO_COLOR set, I'm still seeing colorized output. When using the tool otherwise, NO_COLOR seems to work.

(Thanks for this tool. It looks great.)

telemachus avatar Nov 25 '22 14:11 telemachus

Hi @telemachus,

I confirm that NO_COLOR=please git-dmb --configure will show unexpected color output in that part of the application, that's a bug, true. Are any other parts of the application affected that I am not away of?

The truncation however is not something I could observe or reproduce here. What version of git-delete-merged-branches is this and what else can you share to allow me reproduce the issue? E.g. what therminal is this, what's the value of $TERM etc. Thanks in advance!

hartwork avatar Nov 25 '22 18:11 hartwork

Hi @telemachus,

Hi: thanks for the quick reply.

I confirm that NO_COLOR=please git-dmb --configure will show unexpected color output in that part of the application, that's a bug, true. Are any other parts of the application affected that I am not away of?

Not that I can see. I tried --dry-run, --help, and --yes, and they seem to respect NO_COLOR.

The truncation however is not something I could observe or reproduce here. What version of git-delete-merged-branches is this and what else can you share to allow me reproduce the issue? E.g. what therminal is this, what's the value of $TERM etc. Thanks in advance!

  • git-delete-merged-branches 7.2.0
  • Python 3.10.8
  • macOS 12.6.1
  • iTerm2 Build 3.4.18
  • echo $TERM xterm-256color

Both Python and git-delete-merged-branches are installed via MacPorts. However, I created a virtual environment and installed git-delete-merged-branches in the virtual environment, and I'm seeing the same issue. I'm not sure how else I can help you to reproduce the issue. It absolutely may be something odd about my setup, but I'm at a loss to guess what that might be. (My only guess was that my prompt was getting in the way, but I reset that to a minimal $ , and I still have the problem.)

Please let me know if you can think of other specific things to check. Thanks for your time, and thanks again for git-dmb.

telemachus avatar Nov 25 '22 22:11 telemachus

Hi @telemachus,

I checked my $TERM and it is set to xterm-256color as well. All my boxes are flavors of Linux so I cannot test with iTerm2 myself easily, I'm afraid. Could it be that the environment has other variables set that apply here, e.g. $COLUMNS? Can you check the output of printenv? Any other ideas?

What you're expected to see btw would be something like this (minus the rounded rectangle highlight, taken from unrelated https://github.com/hartwork/git-delete-merged-branches/issues/81#issuecomment-1206894629): git-dmb-Screenshot_20220805_232242

hartwork avatar Nov 25 '22 22:11 hartwork

PS: @telemachus could you try running the tool in environment with no variables set other than $PATH, e.g.

env -i \
    PATH="$(dirname "$(type -P git-delete-merged-branches)"):$(dirname "$(type -P git)")" \
    git-delete-merged-branches --configure

or even

env -i PATH="${PATH}" git-delete-merged-branches --configure

?

hartwork avatar Nov 25 '22 22:11 hartwork

PPS: My env is of GNU coreutils in case non-Homebrew env is BSD-ish and wants different parameters on macOS…

hartwork avatar Nov 25 '22 22:11 hartwork

Here's the output of printenv: https://gist.github.com/telemachus/5521c05c9d0a64f19894e89ba15f8553. I don't see anything there that jumps out at me, but maybe you will.

Here's the command with a restricted environment.

$ env -i PATH="${PATH}" git-delete-merged-branches-3.10 --configure
Configure git-delete-merged-branches for repository 'notes':
een merged to?

▶ [x] main

(Press [Space] to toggle selection, [Enter]/[Return] to accept, [Ctrl]+[C] to quit.)

I also tried with Mac's built-in Terminal.app, and I get a similar result (maybe slightly worse?).

$ env -i PATH="${PATH}" git-delete-merged-branches-3.10 --configure
Configure git-delete-merged-branches for repository 'notes':
ave been merged to?
 
▶ [x] main  
 
it.)

I'll keep looking, but I understand if you close this as "cannot reproduce."

telemachus avatar Nov 25 '22 23:11 telemachus

@telemachus thanks for trying and sharing these things. The only thing in the environment I find that I'm not clear about is __CF_USER_TEXT_ENCODING :shrug: I'd be happy to understand and fix this truncation issue, and I have some hope left we may get to that point one way or another. It puzzles me, why you'd be the only user with this behavior on macOS so far (if you are), but there is probably some answer waiting to be found on that front.

PS: If you feel like doing a video call with screen sharing and some experimentation on this matter, I'd be up for that, but I'd also totally understand if that's "a bit too much" with some stranger from the internet (me) — please don't feel talked into it. In any case, my e-mail contact is on my profile, timezone is UTC+1 for me, and I'm a lot closer to night owl than early bird regarding wake times these very days.

hartwork avatar Nov 26 '22 01:11 hartwork

PS: @telemachus the part that is truncated is rendered by Python library prompt-toolkit. One thing we could try is installing a different version of that library — either more recent or more ancient — and see if it has any impact. Or run one of their code examples (demoed by screenshots in their gallery) in isolation and see if they appear healthy or broken on your system. Just an idea.

hartwork avatar Nov 26 '22 01:11 hartwork

PS: @telemachus the part that is truncated is rendered by Python library prompt-toolkit. One thing we could try is installing a different version of that library — either more recent or more ancient — and see if it has any impact. Or run one of their code examples (demoed by screenshots in their gallery) in isolation and see if they appear healthy or broken on your system. Just an idea.

I'll look into this tomorrow and get back to you. Thanks for all the help and suggestions.

telemachus avatar Nov 26 '22 02:11 telemachus

PS: @telemachus the part that is truncated is rendered by Python library prompt-toolkit. One thing we could try is installing a different version of that library — either more recent or more ancient — and see if it has any impact. Or run one of their code examples (demoed by screenshots in their gallery) in isolation and see if they appear healthy or broken on your system. Just an idea.

I'll look into this tomorrow and get back to you. Thanks for all the help and suggestions.

So, unfortunately, no joy. I installed prompt-toolkit and tried many (not all) of the examples, and I cannot see a problem there. I am going to keep experimenting with my shell's setup. I assume it's something odd at my end.

You are welcome to leave this open for further comments (or Googlers, in case someone else has the issue) or to close it. Either way, if I get more information, I'll post again.

Thanks for quickly fixing the part that you could reproduce.

telemachus avatar Nov 27 '22 16:11 telemachus

@telemachus okay, let's keep the ticket open, I will drop the " and does not respect NO_COLOR" part from the title in a second since that half is fixed, and will do a release 7.2.2 with the fix shortly — later today with some luck.

hartwork avatar Nov 27 '22 16:11 hartwork

@telemachus 7.2.2 is on PyPI now

hartwork avatar Nov 27 '22 16:11 hartwork

Got it, and the colors are gone now when I run --config. Thanks.

telemachus avatar Nov 27 '22 19:11 telemachus