From: Nadav Har'El <n...@scylladb.com>
Committer: Nadav Har'El <n...@scylladb.com>
Branch: master

python2x: fix terminal setting

Before this patch, trying to run python interactively ("run.py -e /python")
results in backspaces not working (outputting spaces instead).

It turns out that for backspaces to work, we need to set TERM, and need
that terminal definition to exist. In this patch we require the "unknown-term"
package - which defines the "unknown" terminal.

Sadly, while terminfo can handle an unset TERM environment variable - as is
the default on OSv - and fall back to the name "unknown", Python cannot do
this and requires TERM=unknown to be explicitly set. So in this patch we
also add a default command line of "--env=TERM=unknown /python".
As a convenience, we add that command line as the default command line
of the python2x package.

Signed-off-by: Nadav Har'El <n...@scylladb.com>

---
diff --git a/python2x/module.py b/python2x/module.py
--- a/python2x/module.py
+++ b/python2x/module.py
@@ -0,0 +1,4 @@
+from osv.modules import api
+
+api.require('unknown-term')
+default = api.run(cmdline="--env=TERM=unknown /python")

--
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to