diff options
author | Damien George <damien@micropython.org> | 2021-07-27 00:43:35 +1000 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2022-03-10 10:58:33 +1100 |
commit | ac2293161e98e73d39434628f995e85bd97e52c2 (patch) | |
tree | 6cc14ad736b124e085371ec47e734b90f7e98ddd /py/runtime.c | |
parent | cac939ddc3625da7e6cf1cf0309daba25fc1cedb (diff) |
py/modsys: Add optional mutable attributes sys.ps1/ps2 and use them.
This allows customising the REPL prompt strings.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'py/runtime.c')
-rw-r--r-- | py/runtime.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/py/runtime.c b/py/runtime.c index 665c9f220..ba3fbe7fa 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -135,6 +135,11 @@ void mp_init(void) { MP_STATE_VM(sys_exitfunc) = mp_const_none; #endif + #if MICROPY_PY_SYS_PS1_PS2 + MP_STATE_VM(sys_mutable[MP_SYS_MUTABLE_PS1]) = MP_OBJ_NEW_QSTR(MP_QSTR__gt__gt__gt__space_); + MP_STATE_VM(sys_mutable[MP_SYS_MUTABLE_PS2]) = MP_OBJ_NEW_QSTR(MP_QSTR__dot__dot__dot__space_); + #endif + #if MICROPY_PY_SYS_SETTRACE MP_STATE_THREAD(prof_trace_callback) = MP_OBJ_NULL; MP_STATE_THREAD(prof_callback_is_executing) = false; |