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

Fails to detect url boundary #6122

Closed
glensc opened this issue Mar 20, 2023 · 4 comments
Closed

Fails to detect url boundary #6122

glensc opened this issue Mar 20, 2023 · 4 comments
Labels

Comments

@glensc
Copy link
Contributor

glensc commented Mar 20, 2023

Describe the bug

When an url is printed on terminal that is exactly the width of the terminal and next line starts with a word, that word is considered part of the link.

it should understand that stream from the application included newline and not continue with text from next line being part of the text.

Context: this is getting annoying when you push a branch, and then gitlab/github prints you link to create merge request, but the link is incorrect because it includes word "remote:" in the URL end.

To Reproduce
Steps to reproduce the behavior:

  1. open kitty terminal with width >= 120
  2. echo -n 'https://github.com/kovidgoyal/kitty/issues/new?assignees=&labels=bug&template=bug_report.md&title=aaa'; printf -- 'a%.0s' {1..$((COLUMNS-101))}; printf "\n"; printf 'kalamaja'
  3. click the link
  4. the opened link would also include text from next line "kalamala", which should not be there.

Screenshots

image

Environment details

kitty 0.27.1 () created by Kovid Goyal
Darwin grenouille 22.2.0 Darwin Kernel Version 22.2.0: Fri Nov 11 02:03:51 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T6000 arm64
ProductName:		macOS ProductVersion:		13.1 BuildVersion:		22C65
Frozen: True
Paths:
  kitty: /Applications/kitty.app/Contents/MacOS/kitty
  base dir: /Applications/kitty.app/Contents/Resources/kitty
  extensions dir: /Applications/kitty.app/Contents/Resources/Python/lib/kitty-extensions
  system shell: /bin/zsh
Loaded config files:
  /Users/glen/.config/kitty/kitty.conf

Config options different from defaults:
copy_on_select            clipboard
enable_audio_bell         False
font_size                 15.0
select_by_word_characters @-./_~?&=%+#:!
symbol_map: *redacted*
Added mouse actions:
	cmd+left release grabbed →  mouse_handle_click link
	cmd+left release ungrabbed →  mouse_handle_click link
Added shortcuts: *redacted*


Important environment variables seen by the kitty process:
	PATH                                /Applications/kitty.app/Contents/MacOS:/usr/bin:/bin:/usr/sbin:/sbin
	LANG                                en_US.UTF-8
	SHELL                               /bin/zsh
	DISPLAY                             *redacted*
	USER                                glen

@glensc glensc added the bug label Mar 20, 2023
@kovidgoyal
Copy link
Owner

Newlines do not break URLs in order to support applications like mutt
that insert newlines at the end of URLs. The case of a URL ending
exactly at the end of the line is much rarer than URLs extending over
multiple lines.

@glensc
Copy link
Contributor Author

glensc commented Mar 20, 2023

Should I go to the casino then? it happened to me more than 5 times already in short time I've been using Kitty. This problem does not exist in any other terminal i've used, iTerm for example.

If this is mutt specific hack, is it reported to mutt? maybe add opt-out config then?

@kovidgoyal
Copy link
Owner

Should I go to the casino then?

Feel free.

@glensc
Copy link
Contributor Author

glensc commented Mar 21, 2023

Thanks!

Note to self:

url_excluded_characters \n

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants