Skip to content

Hangs php until I press a key #422

Open

Description

@JasonWoof

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.

Activity

  1. proff321 commented on Jul 30, 2019

    @proff321

    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.

  2. JasonWoof commented on Jul 30, 2019

    @JasonWoof
    ContributorAuthor

    :) 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.

  3. BlackIkeEagle commented on Aug 5, 2019

    @BlackIkeEagle
    Member

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

  4. JasonWoof commented on Aug 5, 2019

    @JasonWoof
    ContributorAuthor

    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.

  5. Taluu commented on Aug 5, 2019

    @Taluu

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

  6. BlackIkeEagle commented on Aug 5, 2019

    @BlackIkeEagle
    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.

  7. ltgouvea commented on Oct 31, 2019

    @ltgouvea

    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?

  8. drasill commented on Nov 4, 2019

    @drasill

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

  9. BlackIkeEagle commented on Nov 4, 2019

    @BlackIkeEagle
    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

  10. JasonWoof commented on Nov 4, 2019

    @JasonWoof
    ContributorAuthor

    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.

  11. mkindred commented on Jul 21, 2020

    @mkindred

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions