Prompt: Added a prompt (Still buggy a little if it contains dollarsigns)
This commit is contained in:
parent
ef34936d29
commit
0d8354ddd9
|
@ -371,9 +371,13 @@ when isMainModule:
|
|||
# ctrlc handler
|
||||
setControlCHook(ctrlc)
|
||||
let stdinstrm = stdin.newFileStream
|
||||
# Set the default prompt
|
||||
shellVariables["PROMPT"] = "$PWD \\$"
|
||||
stdout.write(shellVariables["PROMPT"].newStringStream.substitute)
|
||||
while not stdinstrm.atEnd():
|
||||
try:
|
||||
discard stdinstrm.readCommand.execute
|
||||
stdout.write(shellVariables["PROMPT"].newStringStream.substitute)
|
||||
except ShellError, ShellCommandError, ShellVariableError:
|
||||
let e = getCurrentException()
|
||||
stderr.write(e.msg, "\n")
|
||||
|
|
Loading…
Reference in New Issue