English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 07 March 2016, 21:04   #1
patrik
Registered User
 
patrik's Avatar
 
Join Date: Jan 2005
Location: Umeå
Age: 43
Posts: 926
Disconnect from shell

How do you do to disconnect your program from the current shell and continue running it in the background?

The idea would be to only start running in the background if certain conditions are met, like a unix daemon.

The CED editor does something this, it even allows you to close the shell you started it from while it is running.
patrik is offline  
Old 08 March 2016, 09:19   #2
ajk
Registered User
 
ajk's Avatar
 
Join Date: May 2010
Location: Helsinki, Finland
Posts: 1,341
Try

run >NIL: command
ajk is offline  
Old 08 March 2016, 09:41   #3
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,335
Quote:
Originally Posted by ajk View Post
Try

run >NIL: command
This does not allow to close the shell.
To make a real self-detaching program, you have to programmatically run your program (with some way for it to identify it's rerun out of the cli), then quit the original one (dunno if this is clear ).
meynaf is offline  
Old 08 March 2016, 11:22   #4
hooverphonique
ex. demoscener "Bigmama"
 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,630
I've done this in the past. As far as I remember, I did something like:

add extra code section to start of program/seglist which detaches the following sections from the seglist and then creates a new process based on the detached sections, then exits. There may be some details about setting standard input/output for the new process also, I don't remember.
hooverphonique is offline  
Old 08 March 2016, 17:11   #5
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
Redirecting output to NIL: like ajk says works, so if your program doesn't need to print anything in the shell before it detaches, that's your simple solution.

There's also a program on Fish 399, TrackDisplay by Olaf Barthel, which shows how to programmatically detach from the CLI, allowing you to close it afterwards.
Leffmann is offline  
Old 08 March 2016, 20:09   #6
patrik
Registered User
 
patrik's Avatar
 
Join Date: Jan 2005
Location: Umeå
Age: 43
Posts: 926
Thanks for the TrackDisplay example, that's exactly what I want to do!
patrik is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Clear background color for Shell window- Shell-StartUp fc.studio support.Apps 13 25 March 2022 18:52
A lua shell for FS-UAE lallafa support.FS-UAE 10 14 August 2020 20:35
remote shell howto ovale support.WinUAE 18 26 April 2015 17:50
Shell help? madman support.Apps 5 24 June 2011 22:32
Shell Replacement amiga request.UAE Wishlist 6 22 January 2009 19:44

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 07:40.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.07410 seconds with 13 queries