Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] TestTabWithColorBox test fails on macos terminal #29

Open
nedpals opened this issue Aug 22, 2022 · 12 comments
Open

[BUG] TestTabWithColorBox test fails on macos terminal #29

nedpals opened this issue Aug 22, 2022 · 12 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@nedpals
Copy link

nedpals commented Aug 22, 2022

Describe the bug
When running the test especially on TestTabWithColorBox, it crashes (specifically an out-of-bounds crash)

To Reproduce
Steps to reproduce the behavior:

  1. Test go test -v .
  2. See error

Expected behavior
Successful test

Screenshots / Logs
image

Versions (please complete the following information, if relevant):

  • Software version: dev branch
  • OS: Mac OS 11.6
  • Golang version: 1.19
  • Terminal using and Version: MacOS Terminal 2.11

Additional context
Debugging the text and the separator in runes shows the following results:

color.ClearCode(topBar): [9484 32 66 111 120 32 32 32 32 32 67 76 73 32 32 32 32 32 77 97 107 101 114 32 32 32 128230 32 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9472 9488]
color.ClearCode(title): [66 111 120 32 32 32 67 76 73 32 32 32 32 32 77 97 107 101 114 32 32 32 128230]

the title text in the topbar in []runes (the color.clearCode(topBar)) is 66 111 120 32 32 32 32 32 67 76 73 32 32 32 32 32 77 97 107 101 114 32 32 32 128230
while the separator (the color.clearCode(title)) is 66 111 120 32 32 32 67 76 73 32 32 32 32 32 77 97 107 101 114 32 32 32 128230

if you look at it closely on the first set of 32s the text has 5 32s while the separator has only 3 32s

probably an issue with the ClearCode method

@nedpals nedpals added the bug Something isn't working label Aug 22, 2022
@Delta456 Delta456 self-assigned this Aug 22, 2022
@Delta456
Copy link
Owner

This is quite an interesting issue.

@inhere
Copy link

inhere commented Aug 23, 2022

hi @nedpals can provide the topBar and title string.

@Delta456
Copy link
Owner

I can confirm that this test works on iterm2

img

@nedpals
Copy link
Author

nedpals commented Aug 25, 2022

hi @nedpals can provide the topBar and title string.

here are the values (i'll just paste them as []rune as turning them to strings might lose info)

topBar := string([]rune{9484, 32, 66, 111, 120, 32, 32, 32, 32, 32, 67, 76, 73, 32, 32, 32, 32, 32, 77, 97, 107, 101, 114, 32, 32, 32, 128230, 32, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9472, 9488})

title := string([]rune{66, 111, 120, 32, 32, 32, 67, 76, 73, 32, 32, 32, 32, 32, 77, 97, 107, 101, 114, 32, 32, 32, 128230})

@inhere
Copy link

inhere commented Aug 27, 2022

there are runes is after call color.ClearCode() ?
can provide them on before call func ClearCode()

@Delta456
Copy link
Owner

there are runes is after call color.ClearCode() ? can provide them on before call func ClearCode()

There are the runes before ClearCode function call.

color.ClearCode(topBar) has []rune{66, 111, 120, 32, 32, 32, 32, 32, 67, 76, 73, 32, 32, 32, 32, 32, 77, 97, 107, 101, 114, 32, 32, 32, 128230}

color.ClearCode(title) has []rune{66, 111, 120, 32, 32, 32, 67, 76, 73, 32, 32, 32, 32, 32, 77, 97, 107, 101, 114, 32, 32, 32, 128230}

@Delta456
Copy link
Owner

Delta456 commented Sep 4, 2022

@inhere Can you work on solving this?

@inhere
Copy link

inhere commented Sep 4, 2022

@Delta456 xstrings.ExpandTabs maybe has error

see:

image

@Delta456
Copy link
Owner

Delta456 commented Sep 7, 2022

@Delta456 xstrings.ExpandTabs maybe has error

see:

image

This seems to work on iterm2 and the rest terminals except iterm. Can you check what should be the tab size for iterm? I will add a workaround for it.

@inhere
Copy link

inhere commented Oct 9, 2022

hi @Delta456 I am running the test directly in MacOS GoLand

@Delta456
Copy link
Owner

Delta456 commented Oct 9, 2022

hi @Delta456 I am running the test directly in MacOS GoLand

I see. I really wonder why it fails on iterm.

@griimick
Copy link

I don't think you can even run iterm in the newer versions of MacOS. Couldn't repro this issue in MacOS Terminal 2.12.7 or Iterm2 v3.4.16 in MacOS v12.6

@Delta456 Delta456 added the help wanted Extra attention is needed label Oct 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants