Remvoe win_unicode_console support

The new Windows terminal solves the problem
of unicode on windows much better
This commit is contained in:
Morten Enemark Lund 2019-10-07 22:21:13 +02:00
parent 4805f10095
commit 46cdf40b9b
4 changed files with 1 additions and 29 deletions

View file

@ -398,7 +398,6 @@ def main():
skw["extras_require"] = {
"ptk": ["prompt-toolkit"],
"pygments": ["pygments>=2.2"],
"win": ["win_unicode_console"],
"mac": ["gnureadline"],
"linux": ["distro"],
"proctitle": ["setproctitle"],

View file

@ -59,7 +59,6 @@ from xonsh.tools import (
bool_seq_to_csv,
DefaultNotGiven,
print_exception,
setup_win_unicode_console,
intensify_colors_on_win_setter,
is_dynamic_cwd_width,
to_dynamic_cwd_tuple,
@ -578,7 +577,6 @@ def DEFAULT_ENSURERS():
"VC_HG_SHOW_BRANCH": (is_bool, to_bool, bool_to_str),
"VI_MODE": (is_bool, to_bool, bool_to_str),
"VIRTUAL_ENV": (is_string, ensure_string, ensure_string),
"WIN_UNICODE_CONSOLE": (always_false, setup_win_unicode_console, bool_to_str),
"XONSHRC": (is_env_path, str_to_env_path, env_path_to_str),
"XONSH_APPEND_NEWLINE": (is_bool, to_bool, bool_to_str),
"XONSH_AUTOPAIR": (is_bool, to_bool, bool_to_str),
@ -762,7 +760,6 @@ def DEFAULT_VALUES():
"VC_BRANCH_TIMEOUT": 0.2 if ON_WINDOWS else 0.1,
"VC_HG_SHOW_BRANCH": True,
"VI_MODE": False,
"WIN_UNICODE_CONSOLE": True,
"XDG_CONFIG_HOME": os.path.expanduser(os.path.join("~", ".config")),
"XDG_DATA_HOME": os.path.expanduser(os.path.join("~", ".local", "share")),
"XONSHRC": default_xonshrc,
@ -1194,11 +1191,6 @@ def DEFAULT_DOCS():
"VIRTUAL_ENV": VarDocs(
"Path to the currently active Python environment.", configurable=False
),
"WIN_UNICODE_CONSOLE": VarDocs(
"Enables unicode support in windows terminals. Requires the external "
"library ``win_unicode_console``.",
configurable=ON_WINDOWS,
),
"XDG_CONFIG_HOME": VarDocs(
"Open desktop standard configuration home dir. This is the same "
"default as used in the standard.",

View file

@ -17,7 +17,7 @@ from xonsh.pretty import pretty
from xonsh.execer import Execer
from xonsh.proc import HiddenCommandPipeline
from xonsh.jobs import ignore_sigtstp
from xonsh.tools import setup_win_unicode_console, print_color, to_bool_or_int
from xonsh.tools import print_color, to_bool_or_int
from xonsh.platform import HAS_PYGMENTS, ON_WINDOWS
from xonsh.codecache import run_script_with_cache, run_code_with_cache
from xonsh.xonfig import print_welcome_screen
@ -356,8 +356,6 @@ def premain(argv=None):
env["XONSH_INTERACTIVE"] = args.force_interactive or (
args.mode == XonshMode.interactive
)
if ON_WINDOWS:
setup_win_unicode_console(env.get("WIN_UNICODE_CONSOLE", True))
return args
@ -462,8 +460,6 @@ def main_xonsh(args):
def postmain(args=None):
"""Teardown for main xonsh entry point, accepts parsed arguments."""
if ON_WINDOWS:
setup_win_unicode_console(enable=False)
builtins.__xonsh__.shell = None

View file

@ -1556,21 +1556,6 @@ def dict_to_str(x):
return str(x)
def setup_win_unicode_console(enable):
""""Enables or disables unicode display on windows."""
try:
import win_unicode_console
except ImportError:
win_unicode_console = False
enable = to_bool(enable)
if ON_WINDOWS and win_unicode_console:
if enable:
win_unicode_console.enable()
else:
win_unicode_console.disable()
return enable
# history validation
_min_to_sec = lambda x: 60.0 * float(x)