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

[wip] Added support to screen foreground, fixes #83 #84

Closed
wants to merge 4 commits into from
Closed

[wip] Added support to screen foreground, fixes #83 #84

wants to merge 4 commits into from

Conversation

rodrigorm
Copy link

Im trying to add support to screen foreground execution using splits. This is work done until now, but getting some errors, like:

:Dispatch sleep 2

Running this open the split but this errors appears on vim:

Error detected while processing function dispatch#compile_command..<SNR>57_dispatch..dispatch#screen#handle..dispatch#screen#spawn:
line   22:
E484: Can't open file /tmp/vu7hFCf/2

The file /tmp/vu7hFCf/2 is the file on the request.file argument to dispatch#screen#handle() call.

@rodrigorm rodrigorm mentioned this pull request Aug 11, 2014
@tpope
Copy link
Owner

tpope commented Aug 11, 2014

My first observation is that you're going to a great deal of trouble to replicate tmux's pane id solution with $WINDOW, but the fact that $WINDOW isn't unique makes that a round peg square hole sort of deal. Plus the use of indicators like bottom and up suggests it won't work unless we're the sole pane to start with. My recommendation would be to support a single split only. Then you can just save the individual request rather than a dictionary mapping between pane ids and requests.

Your immediate problem is that you're writing s:make_pane asynchronously, but trying to read it immediately afterwards, before it's had a chance to be written.

@rodrigorm
Copy link
Author

Ok, nice idea, let me try.

@rodrigorm rodrigorm changed the title [wip] Added support to screen foreground, fixes #83. [wip] Added support to screen foreground, fixes #83 Aug 11, 2014
@rodrigorm
Copy link
Author

I have changed like you say, I'm thinking of displaying an error message if run more than once. What do you think?

@tpope
Copy link
Owner

tpope commented Aug 11, 2014

No, just run synchronously instead.

Do you have a reason for changing silent ! to call system()? That causes problems under some setups.

@rodrigorm
Copy link
Author

Sorry, I dont understand, how to run synchronously?

I change to call system because of tmux, let me back to silent !

@tpope
Copy link
Owner

tpope commented Aug 11, 2014

Return 0 to hand things off to the next adapter and, ultimately, run synchronously. Take this conditional and make it something like

if !get(a:request, 'background', 0) && empty(v:servername) && !empty(s:waiting)

@rodrigorm
Copy link
Author

Ok, added the return 0 and woked. But the silent ! does not work, I get this error after 2 or more calls:

:Dispatch sleep 2
[screen caught signal 11. (core dumped)] 

@tpope
Copy link
Owner

tpope commented Aug 11, 2014

Doubtful it's the root cause but your substitute(command, '"', '\"', '') is definitely the wrong way to shell escape. What I would do is split this into multiple silent !s. First "split" "focus down" "resize 10", then exec the actual command, then focus up.

@rodrigorm
Copy link
Author

I have tried this, but the focus up does not work and focus continues on the split.

@tpope
Copy link
Owner

tpope commented Aug 12, 2014

Push what you have and I can take a look when I have time.

@rodrigorm
Copy link
Author

Did you see the changes?

@rodrigorm rodrigorm closed this Jun 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants