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

Right Clicking on a link in QTerminal makes "Open Link" and "Copy Link Address" Appear but go away #358

Open
tsimonq2 opened this Issue Sep 29, 2017 · 8 comments

Comments

3 participants
@tsimonq2
Copy link
Member

tsimonq2 commented Sep 29, 2017

The title explains it all, here's a quick unlisted YouTube video that shows it in real action.

I'm using my daily PPA which is the tip of the QTerminal master tree.

@tsimonq2 tsimonq2 assigned tsimonq2 and unassigned tsimonq2 Sep 29, 2017

@tsimonq2

This comment has been minimized.

Copy link
Member

tsimonq2 commented Sep 29, 2017

This is going to be a tricky one, I don't think it's a regression in QTerminal but rather QTermWidget... I'll leave this up to the people who know the codebase a bit better than I.

@tsimonq2 tsimonq2 removed the pending label Sep 30, 2017

@yan12125

This comment has been minimized.

Copy link
Member

yan12125 commented Oct 11, 2017

Here's a possible fix: https://github.com/lxde/qtermwidget/tree/wip/issue358 with https://github.com/lxde/qterminal/tree/wip/issue358. I don't think it's ready for a pull request...

The cause is: when the image (contents in the terminal) changes, all filter hotspots (e.g. recognized URLs) are deleted, and Open & Copy actions use filter objects as parents, so they are deleted, too.

The idea of my fix is: use the popu menu as parents of Open & Copy actions and defer deletion of filter objects. This is achieved by recording that a filter object is used by someone else (_hasAnotherParent). When both Open & Copy actions are deleted, the relevant filter object is deleted, too. Here I use std::shared_ptr to record whether a filter object is really no longer used by anyone or not.

My test case:

  1. Open a text file with a URL via NeoVim. I have set mouse=a in my ~/.config/nvim/init.vim
  2. Right click on the URL and choose either Copy Link Address or Open Link.

My checks:

  • Open & Copy actions appear and gone before patching, and they're working fine after the patch
  • valgrind doesn't complain about illegal access or memory leaks about filters

BTW, Konsole just don't allow me to right click a URL in NeoVim. I was trying to find an elegant solution there :(

@tsimonq2

This comment has been minimized.

Copy link
Member

tsimonq2 commented Jun 24, 2018

Bump; I'm willing to put a bounty on this too if it would help.

I'm personally affected by this and I keep getting user reports about it.

@yan12125

This comment has been minimized.

Copy link
Member

yan12125 commented Jun 24, 2018

@tsimonq2: I created pull requests from my last attempt. I'm not 100% sure those changes are correct. Please test it, thanks!

@agaida

This comment has been minimized.

Copy link
Member

agaida commented Jun 24, 2018

https://youtu.be/nlRjQ9Gc8E0 - not sure why there is a bug - can't reproduce it

@yan12125

This comment has been minimized.

Copy link
Member

yan12125 commented Jun 24, 2018

This bug occurs if terminal texts are modified after the click. For example in vim/neovim with :set mouse=a.

@agaida

This comment has been minimized.

Copy link
Member

agaida commented Jun 24, 2018

ahhh - ok - thanks for the clarification

@agaida agaida added this to test in Issues Aug 11, 2018

@agaida agaida added this to Done in Issues Nov 26, 2018

@yan12125

This comment has been minimized.

Copy link
Member

yan12125 commented Jan 12, 2019

Memory management appears more aggressive in Qt 5.12, resulting in crashes. I have no good fix yet, so I revert relevant changes: lxqt/qtermwidget#242, #536

@yan12125 yan12125 reopened this Jan 12, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment