2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: NewShell CLI Command
9 /******************************************************************************
26 Create a new shell in a new console window. This window will become
29 The window belonging to the new shell may be specified by
30 using the WINDOW keyword.
34 WINDOW -- Specification of the shell window
36 X -- number of pixels from the left edge of
38 Y -- number of pixels from the top edge of
40 WIDTH -- width of the shell window in pixels
41 HEIGHT -- height of the shell window in pixels
42 TITLE -- text to appear in the shell window's
44 AUTO -- the window automatically appears when the
45 program needs input or output
46 ALT -- the window appears in the specified size
47 and position when the zoom gadget is clicked
48 BACKDROP -- the window is a backdrop window
49 CLOSE -- include a close gadget
50 INACTIVE -- the window is not made active when opened
51 NOBORDER -- the window is borderless, only the size,
52 depth and zoom gadgets are available
53 NOCLOSE -- the window has no close gadget
54 NODEPTH -- the window has no depth gadget
55 NODRAG -- the window cannot be drag; implies NOCLOSE
56 NOSIZE -- the window has no size gadget
57 SCREEN -- name of a public screen to open the window on
58 SIMPLE -- if the window is enlarged the text expands to
59 fill the available space
60 SMART -- if the window is enlarged the text will not
62 WAIT -- the window can only be closed by selecting
63 the close gadget or entering CTRL-\.
66 FROM -- File to execute before resorting to normal shell
67 operations. If nothing is specified S:Shell-Startup
75 As opposed to C:NewShell, this is a Workbench Tool.
87 ******************************************************************************/
89 #include <aros/debug.h>
90 #include <clib/alib_protos.h>
92 #include <exec/memory.h>
93 #include <proto/exec.h>
94 #include <proto/dos.h>
95 #include <dos/dosextens.h>
96 #include <dos/dostags.h>
97 #include <aros/asmcall.h>
99 #include <workbench/startup.h>
101 int main(int argc
, char **argv
)
104 LONG rc
= RETURN_FAIL
;
106 tt
= ArgArrayInit(argc
, (UBYTE
**)argv
);
111 stack
= ArgInt(tt
, "STACK", AROS_STACKSIZE
);
112 from
= Open(ArgString(tt
, "FROM", "S:Shell-Startup"), MODE_OLDFILE
);
113 win
= Open(ArgString(tt
, "WINDOW", "CON:0/50//130/AROS-Shell/CLOSE"), MODE_NEWFILE
);
115 if (stack
< AROS_STACKSIZE
)
116 stack
= AROS_STACKSIZE
;
120 struct TagItem tags
[] =
122 { SYS_Asynch
, TRUE
},
123 { SYS_Background
, FALSE
},
124 { SYS_Input
, (IPTR
)win
},
125 { SYS_Output
, (IPTR
)NULL
},
126 { SYS_Error
, (IPTR
)NULL
},
127 { SYS_ScriptInput
, (IPTR
)from
},
128 { SYS_UserShell
, TRUE
},
129 { NP_StackSize
, stack
},
133 rc
= SystemTagList("", tags
);