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

Hangs php until I press a key #422

Open
JasonWoof opened this issue Jul 25, 2019 · 11 comments
Open

Hangs php until I press a key #422

JasonWoof opened this issue Jul 25, 2019 · 11 comments

Comments

@JasonWoof
Copy link
Contributor

I refresh the page or run the ajax call or whatever's runs php with xdebug, then nothing happens (php doesn't run, vdebug interface doesn't pop up)

I want vdebug to run at this point.

Workaround: I press an arrow key then vdebug starts up.

Request: I'd like vdebug to run automatically when php/xdebug connects, and not wait for me to touch the keyboard. Maybe this was not possible when vdebug was originally written, but surely it is possible with vim 8.

@proff321
Copy link

I noticed the same issue while working with a PHP code base. You must refocus on vim before the debugger will allow the PHP script to continue execution. In my case, I was having to press F5 which somehow "woke up" the plugin and then continued the execution of the script.

Thus far I've located the logic which should check to see if there is an active connection ready for debugging. However, I need to research the CursorHold vim event to see how long vim waits before triggering the event.

As an immediate next step I think we should create a simple PHP script and plugin config which reliably reproduces this issue.

@JasonWoof
Copy link
Contributor Author

:) that looks like the problem all right :)

Looks like it's checking for a debuggable process on keypress/focus/etc.

Instead, in versions that support it (8+ I think) I'd like vdebug instead to call job_start(... {'out_cb': ...}) or some such so it can be notified immediately when a debugger is requested.

@BlackIkeEagle
Copy link
Member

I can't reproduce this issue consistently, I only have this occasionally which made me not really look into it.

@JasonWoof
Copy link
Contributor Author

Do you run vim in the terminal? It's a little easier there, because it doesn't have the FocusGained event.

Also, inconsistency is probably caused by the CursorHold/CursorHoldI callbacks, which trigger after an inactivity delay, mine is after 4 seconds of no keyboard activity. See :help CursorHold

As a temporary workaround you could :set updatetime=500 in your ``.vimrc`. This also makes vim write its swap file much sooner.

@Taluu
Copy link

Taluu commented Aug 5, 2019

I also have to always input something (even only a h does thew rtrick) for vdebug to show the interface.

@BlackIkeEagle
Copy link
Member

@JasonWoof Yes I always run vim in the terminal and I very occasionaly have this issue. I will look into it if I can find something. I shortly looked at the channel stuff but have to figure out if this is possible directly in python.

@ltgouvea
Copy link

I've been experiencing this issue everytime I use vdebug (currently on deepin-terminal, but I'll test some others later) 🤔 @BlackIkeEagle Please, what terminal are you using?

@drasill
Copy link

drasill commented Nov 4, 2019

I have the same issue, not occasionally though, but every time.
I'm using neovim on terminology.

@BlackIkeEagle
Copy link
Member

@ltgouvea I'm mostly using termite, but also konsole (kde) and gnome-terminal, there is a need for a solution to trigger the debugging interface once a connection is there, but I did not take the proper time to look into it

@JasonWoof
Copy link
Contributor Author

I think this bug is less evident/reproducible on graphical instances of Vim because vdebug checks if it should start the debugger interface when the FocusGained event fires. Terminals don't notify vim about focus, hence needing to press a key in non-graphical vim instances.

@mkindred
Copy link

I'm experiencing this nearly 100% of my debug sessions. Currently using gnome-terminal.

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

No branches or pull requests

7 participants