emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Emacs unresponsive while executing Sh code block
@ 2015-03-05 18:40 Giacomo M
  2015-03-06  2:11 ` Alexis
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Giacomo M @ 2015-03-05 18:40 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 575 bytes --]

Dear all,
when I C-c C-c in:

#+BEGIN_SRC sh
gnome-terminal
#+END_SRC

a gnome-terminal window appears, but  Emacs hangs until I close it.
In the *Messages* I get:

executing Sh code block...
Wrote /tmp/babel-2307H-J/ob-input-2307i3c
(....here Emacs hangs... then I close gnome-terminal)
Error reading results: (beginning-of-buffer)
Code block produced no output.

If I use emacs -Q ( evaluating just (org-babel-do-load-languages
'org-babel-load-languages '((sh . t))) ) this doesn't happen.

Do you have any idea of what could be triggering such behavior?

Thanks,

Giacomo

[-- Attachment #2: Type: text/html, Size: 842 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Emacs unresponsive while executing Sh code block
  2015-03-05 18:40 Emacs unresponsive while executing Sh code block Giacomo M
@ 2015-03-06  2:11 ` Alexis
  2015-03-06  6:00 ` Nick Dokos
  2015-03-06  6:08 ` Nick Dokos
  2 siblings, 0 replies; 4+ messages in thread
From: Alexis @ 2015-03-06  2:11 UTC (permalink / raw)
  To: emacs-orgmode


On 2015-03-06T05:40:33+1100, Giacomo M <jackjackk@gmail.com> said:

 GM> Dear all,

 GM> when I C-c C-c in: #+BEGIN_SRC sh gnome-terminal #+END_SRC

 GM> a gnome-terminal window appears, but Emacs hangs until I 
 close GM> it.  In the *Messages* I get:

 GM> executing Sh code block...  Wrote GM> 
 /tmp/babel-2307H-J/ob-input-2307i3c (....here Emacs hangs... then 
 GM> I close gnome-terminal) Error reading results: GM> 
 (beginning-of-buffer) Code block produced no output.

My guess is that Emacs is waiting for the final output from 
`gnome-terminal`, which doesn't get sent until you close 
`gnome-terminal`.


Alexis.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Emacs unresponsive while executing Sh code block
  2015-03-05 18:40 Emacs unresponsive while executing Sh code block Giacomo M
  2015-03-06  2:11 ` Alexis
@ 2015-03-06  6:00 ` Nick Dokos
  2015-03-06  6:08 ` Nick Dokos
  2 siblings, 0 replies; 4+ messages in thread
From: Nick Dokos @ 2015-03-06  6:00 UTC (permalink / raw)
  To: emacs-orgmode

Giacomo M <jackjackk@gmail.com> writes:

> Dear all,
> when I C-c C-c in:
>
> #+BEGIN_SRC sh
> gnome-terminal
> #+END_SRC
>
> a gnome-terminal window appears, but  Emacs hangs until I close it.
> In the *Messages* I get:
>
> executing Sh code block...
> Wrote /tmp/babel-2307H-J/ob-input-2307i3c
> (....here Emacs hangs...then I close gnome-terminal)
> Error reading results: (beginning-of-buffer)
> Code block produced no output.
>

What exactly were you expecting? If you open a terminal window and
start, say, firefox from it, the terminal window will "hang" until you
close firefox - then you get another prompt and can give it some more
input. This is no different. It would be nice if emacs were
multithreaded, but it isn't (at least not yet).

> If I use emacs -Q ( evaluating just (org-babel-do-load-languages
> 'org-babel-load-languages '((sh . t))) ) this doesn't happen.
>

When you say "this" doesn't happen, what do you meant by "this"?  How
does this example compare with the previous example? They look
completely different to me.

-- 
Nick

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Emacs unresponsive while executing Sh code block
  2015-03-05 18:40 Emacs unresponsive while executing Sh code block Giacomo M
  2015-03-06  2:11 ` Alexis
  2015-03-06  6:00 ` Nick Dokos
@ 2015-03-06  6:08 ` Nick Dokos
  2 siblings, 0 replies; 4+ messages in thread
From: Nick Dokos @ 2015-03-06  6:08 UTC (permalink / raw)
  To: emacs-orgmode

Giacomo M <jackjackk@gmail.com> writes:

> Dear all,
> when I C-c C-c in:
>
> #+BEGIN_SRC sh
> gnome-terminal
> #+END_SRC
>

One additional note - you can start the gnome-terminal process in the
background:

#+BEGIN_SRC sh
gnome-terminal &
#+END_SRC

The shell will not wait for the process to finish and emacs will not
hang. 

-- 
Nick

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-03-06  6:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-05 18:40 Emacs unresponsive while executing Sh code block Giacomo M
2015-03-06  2:11 ` Alexis
2015-03-06  6:00 ` Nick Dokos
2015-03-06  6:08 ` Nick Dokos

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).