Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!samsung!uunet!mcsun!corton!mirsa!taloa!taloa.unice.fr!beust From: beust@taloa.unice.fr (Cedric Beust) Newsgroups: comp.sys.amiga.programmer Subject: Re: How do I update the CLI prompt from AL ? Keywords: prompt Assembly CLI Message-ID: <206@taloa.unice.fr> Date: 21 May 91 12:05:06 GMT References: <21738@cbmvax.commodore.com> Sender: news@taloa.unice.fr Reply-To: beust@taloa.unice.fr Organization: University of Nice Sophia-Antipolis Lines: 38 Nntp-Posting-Host: taloa.unice.fr : In article amuser@cutmcvax.cs.curtin.edu.au (Bill Sharp-Smith AUG) writes: :In an assembly language program, I am using lock/unlock, examine, exnext :and currentdir from the DOS library to change directories, but the shell :prompt showing the current directory won't update. : You'll have to write the value yourself. Something like that should do the trick: void Update_Prompt(char *currentdir) /* Update the concerned field with the new current dir */ /* This routine is for users of wshell or such, thar display this name */ /* as the shell prompt. */ { struct Process *pr = (struct Process *) FindTask(0L); struct CommandLineInterface *cli = (struct CommandLineInterface *) (pr -> pr_CLI) << 2; char *p = (char *) (cli -> cli_SetName) << 2; *p++ = strlen(currentdir); /* it is a BSTR, so length first */ while (*currentdir) *p++ = *currentdir++; /* don't add '\0' */ } Really ugly, eh? NOTE: This is extracted from ccd.c in the file incoming/amiga/ccd20.lzh on ab20. +------------------------------------------------------------------------+ | Cedric BEUST University of Nice | | INET: beust@taloa.unice.fr $whoami | | UUCP: llaor.unice.fr!arkonis!beust god (personal alias) | | -- "To be, or not to be...", | | That is illogical, captain! | | -- Spock | +------------------------------------------------------------------------+