zsh-users
 help / color / mirror / code / Atom feed
* detach a process and bring into GNU screen
@ 2008-04-22  4:22 Alexy Khrabrov
  2008-04-22  4:45 ` Bart Schaefer
  2008-04-22  5:15 ` Achille
  0 siblings, 2 replies; 3+ messages in thread
From: Alexy Khrabrov @ 2008-04-22  4:22 UTC (permalink / raw)
  To: zsh-users

I have the following funny setup on my remote server with zsh: without  
GNU screen, I can use LC_ALL=ru_RU.cp1251 and see all my Russian  
letters OK, enter them from my Mac's iTerm app fine, grep them, etc.   
However, in GNU screen, I can't enter the Cyrillics via Mac's standard  
means.

So I detach the screen to get to the bare naked zsh and do my grepping  
there.  Usually it's short.  However, occasionally I grep through my  
billion-word Russian corpus, and it takes a bit.  Sitting outside GNU  
screen means it's vulnerable to an accidental MacBook lid shut event.

Forgetting running naked grep in nohup with stdout redirected to a  
file, I wonder whether zsh can help me to put the process into  
background, detach it somehow, and reattach in a GNU screen window?   
Can I play with stderr/stdout from zsh to achieve this?

Cheers,
Alexy


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

* Re: detach a process and bring into GNU screen
  2008-04-22  4:22 detach a process and bring into GNU screen Alexy Khrabrov
@ 2008-04-22  4:45 ` Bart Schaefer
  2008-04-22  5:15 ` Achille
  1 sibling, 0 replies; 3+ messages in thread
From: Bart Schaefer @ 2008-04-22  4:45 UTC (permalink / raw)
  To: zsh-users

On Apr 21,  9:22pm, Alexy Khrabrov wrote:
}
} Forgetting running naked grep in nohup with stdout redirected to a  
} file, I wonder whether zsh can help me to put the process into  
} background, detach it somehow, and reattach in a GNU screen window?   

Zsh can't help you directly with this, but there's a program named
"retty" ( http://pasky.or.cz/~pasky/dev/retty/ ) which does something
of the sort.  See the list of bugs on that page for some reasons why
shells generally don't attempt to support this.


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

* Re: detach a process and bring into GNU screen
  2008-04-22  4:22 detach a process and bring into GNU screen Alexy Khrabrov
  2008-04-22  4:45 ` Bart Schaefer
@ 2008-04-22  5:15 ` Achille
  1 sibling, 0 replies; 3+ messages in thread
From: Achille @ 2008-04-22  5:15 UTC (permalink / raw)
  To: Alexy Khrabrov; +Cc: zsh-users

Here's another way to do the same, using  'ls -R /' as an example of a
long running process.
Use the following script: http://achille.org/screenify.sh

Naked shell:
* ls -R /  (starts the long process)
* ctrl-z (pause it for a second, go back to the shell)
* disown (will disown the child process, so that it won't die when parent dies)

Inside screen:
 ./screenify.sh PID (disown will tell you the PID)

>From a different shell:
 kill -CONT pid (will restart the process)

You can now kill the naked process.
Should theoretically do the same thing as retty, but the latter does
not work for me (debian, xen kern).

 Cheers


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

end of thread, other threads:[~2008-04-22  5:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-22  4:22 detach a process and bring into GNU screen Alexy Khrabrov
2008-04-22  4:45 ` Bart Schaefer
2008-04-22  5:15 ` Achille

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

	https://git.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).