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

Need for two shells #207

Closed
arkandel opened this issue Apr 21, 2015 · 8 comments
Closed

Need for two shells #207

arkandel opened this issue Apr 21, 2015 · 8 comments

Comments

@arkandel
Copy link

Hey folks,

I've been using vdebug lately and it's really useful. I was wondering if anyone had a solution for the following issue:

I'm mostly debugging PHP over CLI on Linux. When I am doing so now I first hit F10 from vim to start connecting, then from a second shell I run php on the script while exporting the XDEBUG_CONFIG variable.

While this works, it's a bit annoying to have to use two consoles. Does anyone have a way (perhaps a workaround) to avoid this? I tried running a script from within vim after hitting F10 but that didn't work out.

Thanks in advance. :)

@joonty
Copy link
Collaborator

joonty commented May 13, 2015

Hi @arkandel,

Currently that's the best way of doing it. In version 2 of vdebug (which will be released when I get some time to spend on it) the "Waiting for a connection" thing doesn't actually block your vim, so you could potentially run a background command through vim instead. You could check out the version 2 branch as it is an play around?

@joonty joonty added this to the Version 2.0.0 milestone May 13, 2015
@arkandel
Copy link
Author

Ah, right, that'd be convenient. I tried running commands through vim but that didn't pan out, I suppose that's why.

I'll give version 2's branch a try, it's great to know you're working on adding features. Very much appreciated.

@evert
Copy link
Contributor

evert commented May 14, 2015

I hope this is not too inappropriate, but I just wanted to chime in and say I'm also super grateful for vdebug so far, and pumped to see the prospect of a 2.0!

@joonty
Copy link
Collaborator

joonty commented May 15, 2015

Ha, not inappropriate at all @evert! It's encouraging to see people interested in the project.

@simlrh
Copy link

simlrh commented Sep 23, 2015

Until 2.0 comes out, would the following achieve what you need?

:execute "silent !sleep 3 && php yourfile.php &" | :VdebugStart

@BadBrainJohnson
Copy link

For users of Tmux this issue can be solved by the following plugin: https://github.com/christoomey/vim-tmux-runner
Check out this explanatory video: https://vimeo.com/126420226

@ghost
Copy link

ghost commented Nov 5, 2016

I have at least a kludge to solve this problem. Basically I launch a shell command that sleeps for 1 second and then runs the script (in my case python). While the shell command is sleeping I then launch VdebugStart. Code is below. If anybody has any improvements to this let me know as I am very much in my infancy of writing vim scripts.

:function! RunDebug()
:echo 'RunDebug...'
:let debugfile = expand('%:p')
:if debugfile == ''
: echo 'Unsaved File'
:else
: let cmd = 'Start! sleep 1; python -S /drive/python/debugger/pydbgp -d localhost:9000 ' . debugfile
: exec cmd
: VdebugStart
:endif
:endfunction

@BlackIkeEagle
Copy link
Member

You all can start testing the async stuff by using the v2-integration branch

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

6 participants