User's alias and shell-startup
  • MDW
  • Order of the Butterfly
    Order of the Butterfly
    MDW
    Posts: 464 from 2003/7/25
    From: Wroclaw/Poland
    I wanted to add aliasses which will be available after reboot the system.
    In MOSSYS:S exists file shell-startup where we can read:

    Code:
    ;
    ; MorphOS shell-startup
    ;
    ; This script is executed on every new shell invocation.
    ; Do *NOT* modify this file. If you want to change something,
    ; copy this file to S: and make the changes there.
    ;
    ; $VER: shell-startup 1.3
    ;

    Prompt "%S> "
    set _pchar "|"
    set _mchar "&&"
    alias flow "run DETACH sys:Applications/FlowStudio/FlowStudio"


    Ok, I copied the shell-startup file to SYS:S/, added my aliasses below "flow" alias. Everything works well.

    However I am not sure if this is good solution. If in a future a new version of the MorphOS add something to MOSSYS:S/shell-startup, it won't work in my system because MOSSYS:S/shell-startup is ignored if SYS:S/shell-startup file exists (I checked this).

    I am thinking... Is it possible to keep executing original shell-startup before user's shell-startup?

    Or maybe better solution is just add my aliasses to SYS:S/user-startup?

    What do you think?
    Which solution is the most consistent with the MorphOS guidelines?
  • »08.04.23 - 17:22
    Profile Visit Website
  • Just looking around
    jarokuczi
    Posts: 19 from 2016/12/6
    You can create empty file in sys:s and in first line execute mossys:s one. Then add your stuff in following lines.
  • »08.04.23 - 22:45
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    KennyR
    Posts: 878 from 2003/3/4
    From: #AmigaZeux, Gu...
    Quote:

    MDW wrote:
    MOSSYS:S/shell-startup is ignored if SYS:S/shell-startup file exists (I checked this).


    Nothing outside MOSSYS: should override anything in it. If it does, this sounds like a MorphOS bug imo.
  • »09.04.23 - 15:36
    Profile
  • MorphOS Developer
    cyfm
    Posts: 537 from 2003/4/11
    From: Germany
    Quote:

    KennyR schrieb:
    Quote:

    MDW wrote:
    MOSSYS:S/shell-startup is ignored if SYS:S/shell-startup file exists (I checked this).


    Nothing outside MOSSYS: should override anything in it. If it does, this sounds like a MorphOS bug imo.


    This is a bit different for the shell-startup script but you are right for both devices and/or libraries where mossys:devs or mossys:libs is always first and it does either scan the DEVS: or LIBS: path after that (unless the respective device/library is already loaded).

    For the shell-startup script, dos/CLIInitNewCli() first tries to open the script from s:shell-startup and if that doesn't work it explicitly tries MOSSYS:s/shell-startup. Typically, and you can check with shell cmd assign s: EXISTS, the S directory on the system boot partition has precedence over the one in MorphOS/S:

    Typical output :

    Code:
    S          System:S
    + System:MorphOS/S


    So basically, you can indeed put some execute mossys:s/shell-startup in front of your custom shell-startup script to avoid duplicating any lines in the script or if you want to make sure that you don't miss anything there for future updates of the script.
  • »09.04.23 - 16:28
    Profile Visit Website
  • MDW
  • Order of the Butterfly
    Order of the Butterfly
    MDW
    Posts: 464 from 2003/7/25
    From: Wroclaw/Poland
    @cyfm, KennyR, jarokuczi:
    Thank you for all answers. All ideas are very similar - put execute mossys:s/shell-startup in to my sys:s/shell-startup. I think this is good solution which will not break any MOS rules and will work prefect.
    Thanks!
  • »12.04.23 - 10:39
    Profile Visit Website
  • MDW
  • Order of the Butterfly
    Order of the Butterfly
    MDW
    Posts: 464 from 2003/7/25
    From: Wroclaw/Poland
    I have already applied the solution. It works perfect. I didn't touch original shell-startup and I have my custom shell-startup.

    I think this solution should be described in MOSSYS:S/shell-startup file instead current comment.
  • »12.04.23 - 16:57
    Profile Visit Website