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

strange paste behaviour for address bar on Windows #43

Closed
LukeEmmet opened this issue Jul 7, 2020 · 11 comments · Fixed by #107
Closed

strange paste behaviour for address bar on Windows #43

LukeEmmet opened this issue Jul 7, 2020 · 11 comments · Fixed by #107
Labels
bug Something isn't working upstream The issue is with a library.
Milestone

Comments

@LukeEmmet
Copy link

LukeEmmet commented Jul 7, 2020

I'm seeing a strange behaviour - when I try to paste a URL from the clipboard into Amfora on Windows (win10 x64) it seems to truncate the URL. Similar behaviour using the right mouse click or Edit->paste menu, both of which normally paste OK in other apps.

For example here I pasted the following URL: gemini://gemini.marmaladefoo.com/blog/7-Jul-2020_GemiNaut_v0_8_6_release.gmi

the truncation happens as you paste, before you hit enter to navigate to that URL. Amfora cannot navigate as the URL is broken.

amfora_paste_bug

@makew0rld makew0rld added bug Something isn't working help wanted Extra attention is needed labels Jul 8, 2020
@makew0rld
Copy link
Owner

Just wanted to add this here, it was discussed on IRC a while back when the issue originally came up: This is likely due to interplay between the Windows terminal and the TUI library Amfora uses, cview. There isn't much I can do about it, other than file an upstream bug.

@LukeEmmet If you could compile and run this demo code and let me know if it exhibits the same behaviour that'd be helpful. It uses a regular cview inputfield, which would help confirm where the issue lies.

@LukeEmmet
Copy link
Author

I downloaded and compiled the example. Yes it seems the problem is upstream, I get the same problem pasting a URL into that example. I tried adding another URL field with a bigger size, but still the same problem (I think the size is just the visible size not the length of data it will accept):

	AddInputField("URL", "", 400, nil, nil).

I pasted in the URL to the demo https://gitlab.com/tslocum/cview/-/blob/master/demos/form/main.go and you can see below the result.

So it seems to be a CView problem not Amfora.
cview_bug

@makew0rld
Copy link
Owner

Alright, thanks for confirming this!

I think the size is just the visible size not the length of data it will accept

Yes, that's correct.

Also I noticed this screenshot is using Windows Powershell, while the original screenshot seems like something different. Am I correct? What's the application in the first screenshot?

@makew0rld
Copy link
Owner

I filed issue 32 with cview.

@makew0rld makew0rld added the upstream The issue is with a library. label Jul 25, 2020
@LukeEmmet
Copy link
Author

LukeEmmet commented Jul 26, 2020 via email

@makew0rld
Copy link
Owner

This is a known issue in upstream libraries. It appears there are workarounds I could possibly implement.

@makew0rld makew0rld removed the help wanted Extra attention is needed label Aug 30, 2020
@makew0rld
Copy link
Owner

makew0rld commented Aug 30, 2020

This cview commit updates cview to use tcell v2 which has fixed the Windows paste issue. I am planning to update my cview version, so that this issue can be closed.

I will have to do a lot of testing because tcell v2 is unstable, but the short of it is that a fix is coming soon!

Edit: tslocum clarified the changes I'd have to make in this comment. Also waiting on an answer to gdamore/tcell#375, to make sure using truecolor is compatible across many terminals.

@makew0rld makew0rld added this to the v1.6.0 milestone Sep 1, 2020
@makew0rld
Copy link
Owner

Work has begun on the cview-update branch, this will be in the next release likely.

@makew0rld
Copy link
Owner

#104 might be a better way to achieve this update, and then close this issue. I'll work towards merging that PR.

@makew0rld makew0rld mentioned this issue Oct 29, 2020
29 tasks
@makew0rld
Copy link
Owner

Self note

This might have to be moved off of the v1.6.0 milestone, as updating cview is introducing new bugs. See #107 for details. If I end up focusing on other v1.6.0 issues I might make a release that doesn't include this one. The other possibility is focusing on #107 and getting it in.

@makew0rld
Copy link
Owner

This has been fixed in #107, as tested by @LukeEmmet. This issue will be automatically closed once #107 is merged.

@makew0rld makew0rld modified the milestones: v1.6.0, v1.7.0 Nov 4, 2020
@makew0rld makew0rld modified the milestones: v1.7.0, v1.8.0 Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream The issue is with a library.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants