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
|
# ctrlc handler
|
||||||
setControlCHook(ctrlc)
|
setControlCHook(ctrlc)
|
||||||
let stdinstrm = stdin.newFileStream
|
let stdinstrm = stdin.newFileStream
|
||||||
|
# Set the default prompt
|
||||||
|
shellVariables["PROMPT"] = "$PWD \\$"
|
||||||
|
stdout.write(shellVariables["PROMPT"].newStringStream.substitute)
|
||||||
while not stdinstrm.atEnd():
|
while not stdinstrm.atEnd():
|
||||||
try:
|
try:
|
||||||
discard stdinstrm.readCommand.execute
|
discard stdinstrm.readCommand.execute
|
||||||
|
stdout.write(shellVariables["PROMPT"].newStringStream.substitute)
|
||||||
except ShellError, ShellCommandError, ShellVariableError:
|
except ShellError, ShellCommandError, ShellVariableError:
|
||||||
let e = getCurrentException()
|
let e = getCurrentException()
|
||||||
stderr.write(e.msg, "\n")
|
stderr.write(e.msg, "\n")
|
||||||
|
|
Loading…
Reference in New Issue