当我在屏幕内运行 ptpython 并且可能由于自动完成而导致屏幕混乱时,如何修复屏幕?

当我在屏幕内运行 ptpython 并且可能由于自动完成而导致屏幕混乱时,如何修复屏幕?

所以,我正在运行这个命令 os.system(f"screen -S Uploader -d -m bash -c 'bash uploader.sh 2>&1 | tee uploader_log'")

Uploader.sh 依次运行正常显示的 python 脚本。但是,它会from ptpython.repl import embed; embed(globals(), locals())在收到 IndexError 时运行。因此,在出现错误之前,它显示得很好,但它遇到了错误,现在显示得很奇怪,如图所示。

显示不良

正常情况下是这样显示的正常嵌入

有办法解决吗?我猜它与 ptpython 自动完成功能有关?我可以执行 os.system('touch test') 并且它从 repl 中执行得很好。只是它的显示让我烦恼。

作为旁注,screen -S test -d -m bash -c 'python3.12 -c "from ptpython.repl import embed; embed(globals(), locals())"'工作正常。

但是,screen -S test -d -m bash -c 'bash test.sh 2>&1 | tee log'当 test.sh 包含时显示很奇怪python3.12 -c 'from ptpython.repl import embed; embed(globals(), locals())'

相关内容