Google Groups Home
Help | Sign in
How to resume a remote repl session? and edit running code?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  9 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
jingtian...@gmail.com  
View profile  
 More options Jul 28 2008, 3:59 pm
Newsgroups: comp.lang.lisp
From: jingtian...@gmail.com
Date: Mon, 28 Jul 2008 12:59:06 -0700 (PDT)
Local: Mon, Jul 28 2008 3:59 pm
Subject: How to resume a remote repl session? and edit running code?
This is probably a newbie question. And it might have more to do with
ssh setup than lisp.

I'm writing a web/app on a remote ubuntu server through putty. Usually
I develop the code in an emacs/slime repl session open on the remote
server. However sometimes the connection gets cut off (whether
intentionally or not) and I will have to re-login the putty session.
Checking the list of processes I can see that emacs is still running
(sometimes it doesn't, not sure why). Is there anyway I can resume
that emacs/repl session? (Currently, I just kill that old emacs
process and start a new one and reload everything, which can be a
pain.)

This naturally leads to the second question. If I have a remotely
running lisp code, how do you edit it without killing the original
process? Much like in erlang. (I got a feeling that Lisp can do that
from all the motivational Paul Graham essays that got me into lisp.)


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Zach Beane  
View profile  
 More options Jul 28 2008, 4:08 pm
Newsgroups: comp.lang.lisp
From: Zach Beane <x...@xach.com>
Date: Mon, 28 Jul 2008 16:08:12 -0400
Local: Mon, Jul 28 2008 4:08 pm
Subject: Re: How to resume a remote repl session? and edit running code?

jingtian...@gmail.com writes:
> This is probably a newbie question. And it might have more to do with
> ssh setup than lisp.

> I'm writing a web/app on a remote ubuntu server through putty. Usually
> I develop the code in an emacs/slime repl session open on the remote
> server. However sometimes the connection gets cut off (whether
> intentionally or not) and I will have to re-login the putty session.
> Checking the list of processes I can see that emacs is still running
> (sometimes it doesn't, not sure why). Is there anyway I can resume
> that emacs/repl session? (Currently, I just kill that old emacs
> process and start a new one and reload everything, which can be a
> pain.)

I don't know if you can resume the Emacs in any way, sorry.

> This naturally leads to the second question. If I have a remotely
> running lisp code, how do you edit it without killing the original
> process? Much like in erlang. (I got a feeling that Lisp can do that
> from all the motivational Paul Graham essays that got me into lisp.)

I use "screen" to suspend and resume remote sessions. I start emacs and
lisp within screen at boot time via a custom screen config file launched
from a boot script.

Zach


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Steve Allan  
View profile  
 More options Jul 28 2008, 5:25 pm
Newsgroups: comp.lang.lisp
From: Steve Allan <takezow...@yahoo.com>
Date: Mon, 28 Jul 2008 14:25:34 -0700
Local: Mon, Jul 28 2008 5:25 pm
Subject: Re: How to resume a remote repl session? and edit running code?

I second that.  Screen has saved me many times when I lose a remote
connection.  Plus, its a multiplexer, which is pure gold when you're
running in a remote shell.

--
-- Steve


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rupert Swarbrick  
View profile  
 More options Jul 28 2008, 7:21 pm
Newsgroups: comp.lang.lisp
From: Rupert Swarbrick <rswarbr...@gmail.com>
Date: Tue, 29 Jul 2008 00:21:21 +0100
Local: Mon, Jul 28 2008 7:21 pm
Subject: Re: How to resume a remote repl session? and edit running code?

> This is probably a newbie question. And it might have more to do with
> ssh setup than lisp.

> I'm writing a web/app on a remote ubuntu server through putty. Usually
> I develop the code in an emacs/slime repl session open on the remote
> server. However sometimes the connection gets cut off (whether
> intentionally or not) and I will have to re-login the putty session.
> Checking the list of processes I can see that emacs is still running
> (sometimes it doesn't, not sure why). Is there anyway I can resume
> that emacs/repl session? (Currently, I just kill that old emacs
> process and start a new one and reload everything, which can be a
> pain.)

Others have pointed out screen, but I would suggest using Emacs' server
mode. I have the following in my .emacs:

;; Set gnuserve up and run it immediately ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(require 'gnuserv-compat)
(require 'gnuserv)
(setenv "GNUSERV_SHOW_EMACS" "1")
(setenv "GNU_SECURE" "/etc/hosts.emacsallow")
(gnuserv-start)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

And emacsclient works fine for me. I presume that you would be able to
re-login to the putty session and use emacsclient to connect to the
(still running) emacs and slime sessions.

Rupert

  application_pgp-signature_part
< 1K Download

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rob Warnock  
View profile  
 More options Jul 29 2008, 7:11 am
Newsgroups: comp.lang.lisp
From: r...@rpw3.org (Rob Warnock)
Date: Tue, 29 Jul 2008 06:11:39 -0500
Local: Tues, Jul 29 2008 7:11 am
Subject: Re: How to resume a remote repl session? and edit running code?
<jingtian...@gmail.com> wrote:

+---------------
| However sometimes the connection gets cut off (whether
| intentionally or not) and I will have to re-login the putty session.
| Checking the list of processes I can see that emacs is still running
| (sometimes it doesn't, not sure why). Is there anyway I can resume
| that emacs/repl session?
+---------------

Others have mentioned "screen", but also have a look at:

    http://www.cliki.net/detachtty

It lets you start server processes which don't even *have*
a controlling TTY initially, and then connect to them later
if you like [and then disconnect again]. I use it on the
listener (REPL) of CL-based web applications servers.
*Very* convenient...

-Rob

-----
Rob Warnock                     <r...@rpw3.org>
627 26th Avenue                 <URL:http://rpw3.org/>
San Mateo, CA 94403             (650)572-2607


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Petter Gustad  
View profile  
 More options Jul 29 2008, 7:47 am
Newsgroups: comp.lang.lisp
From: Petter Gustad <newsmailco...@gustad.com>
Date: Tue, 29 Jul 2008 13:47:33 +0200
Local: Tues, Jul 29 2008 7:47 am
Subject: Re: How to resume a remote repl session? and edit running code?

r...@rpw3.org (Rob Warnock) writes:
> Others have mentioned "screen", but also have a look at:

>     http://www.cliki.net/detachtty

> It lets you start server processes which don't even *have*
> a controlling TTY initially, and then connect to them later
> if you like [and then disconnect again]. I use it on the
> listener (REPL) of CL-based web applications servers.
> *Very* convenient...

You can do that with "screen" as well. On my web server I have a
crontab entry which starts CMUCL under screen at reboot. It basically
does this:

screen -D -m -S aserve /usr/bin/lisp
       -eval "(asdf:operate 'asdf:load-op :web)"
       -eval "(mp:make-process #'web:start-web-server)"  
       -eval '(mp::startup-idle-and-top-level-loops)'

I can then do a "screen -r aserve" and then run swank:create-server
and slime-connect from emacs.

Petter
--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alexander Schmolck  
View profile  
 More options Jul 29 2008, 11:49 am
Newsgroups: comp.lang.lisp
From: Alexander Schmolck <a.schmo...@gmail.com>
Date: Tue, 29 Jul 2008 16:49:44 +0100
Local: Tues, Jul 29 2008 11:49 am
Subject: Re: How to resume a remote repl session? and edit running code?

To give a simple cookbook example:

start emacs under screen (fixing the emacs-keybinding clashing default prefix):

> screen -e'^zz' emacs

detach with C-z C-d, then resume later with:

> screen -Udr

'as

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
jingtian...@gmail.com  
View profile  
 More options Jul 29 2008, 5:29 pm
Newsgroups: comp.lang.lisp
From: jingtian...@gmail.com
Date: Tue, 29 Jul 2008 14:29:53 -0700 (PDT)
Local: Tues, Jul 29 2008 5:29 pm
Subject: Re: How to resume a remote repl session? and edit running code?
Thanks a lot. I'm using screen with much success. I'm gonna try
detachtty next.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rob Warnock  
View profile  
 More options Jul 30 2008, 6:42 am
Newsgroups: comp.lang.lisp
From: r...@rpw3.org (Rob Warnock)
Date: Wed, 30 Jul 2008 05:42:10 -0500
Local: Wed, Jul 30 2008 6:42 am
Subject: Re: How to resume a remote repl session? and edit running code?
Petter Gustad  <newsmailco...@gustad.com> wrote:
+---------------
| r...@rpw3.org (Rob Warnock) writes:
| > Others have mentioned "screen", but also have a look at:
| >     http://www.cliki.net/detachtty
| > It lets you start server processes which don't even *have*
| > a controlling TTY initially...
|
| You can do that with "screen" as well. ...[example trimmed]...
+---------------

Yes, I know that. But then you're stuck with "screen", which
uses "[n]curses()" and thus messes up the scrollback of the
terminal [while providing its *own* peculiar scrollback, which
you can only do by going into "select" mode, which messes up
cut & paste through X Windows]. Sometimes I prefer that, but
usually it's a hassle and I prefer the (almost) naked pipe
that "detachtty" gives you. It's a matter of taste. YMMV.

-Rob

-----
Rob Warnock                     <r...@rpw3.org>
627 26th Avenue                 <URL:http://rpw3.org/>
San Mateo, CA 94403             (650)572-2607


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google