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

Hostname is truncated if the name contains "[" #5

Closed
Kerwood opened this issue Feb 7, 2022 · 5 comments · Fixed by #10
Closed

Hostname is truncated if the name contains "[" #5

Kerwood opened this issue Feb 7, 2022 · 5 comments · Fixed by #10
Labels
bug Something isn't working

Comments

@Kerwood
Copy link

Kerwood commented Feb 7, 2022

Hi. Thank you for this awesome and simple tool.

If a Hostname contains a [ character, the last character in the hostname is removed.

image

image

To reproduce, add the below hosts to your config.

Host "Host1 production"
  HostName example.org
  User username

Host "Host2 production]"
  HostName example.org
  User username

Host "Host3 [production]"
  HostName example.org
  User username

Host "Host4 [production"
  HostName example.org
  User username
@Kerwood Kerwood closed this as completed Feb 7, 2022
@Kerwood Kerwood reopened this Feb 7, 2022
@Kerwood
Copy link
Author

Kerwood commented Feb 7, 2022

Oops, sorry about that.

@quantumsheep
Copy link
Owner

quantumsheep commented Feb 7, 2022

termui is handling [, ] but also ( and ) characters in a special way. This is very not wanted :/
https://github.com/gizak/termui/blob/4cca61d83fa2cc0f485c478ff768b0108f6591d6/v3/style_parser.go#L11-L24

Seems like there is no option to disable that so we might need to fork the library or switch to a complete other one.

On the bright side, display is broken but it's still working as intended when starting a SSH session.

@Kerwood
Copy link
Author

Kerwood commented Feb 7, 2022

Well, okay. It's not a big deal, I thought it was a minor fix so just wanted to let you know :)
Thank you for looking into it.

@quantumsheep
Copy link
Owner

I will definitely fix it in the near future. I don't know how yet tho.

@quantumsheep
Copy link
Owner

I'm thinking of switching to rivo/tview, it seems more maintained and have more features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants