opensouls / terminal-copilot

A smart terminal assistant that helps you find the right command.
Apache License 2.0
573 stars 43 forks source link

History bug on mac OS terminal #28

Closed kafischer closed 1 year ago

kafischer commented 1 year ago
Traceback (most recent call last):
  File "/usr/local/bin/copilot", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.10/site-packages/copilot/copilot.py", line 83, in main
    {history.get_history() if args.history and operating_system.lower().startswith("lin") or operating_system.lower().startswith("dar") else ""}
  File "/usr/local/lib/python3.10/site-packages/copilot/history.py", line 46, in get_history
    return _zsh_history(history_context_size)
  File "/usr/local/lib/python3.10/site-packages/copilot/history.py", line 29, in _zsh_history
    lines = history_file.zsh_history_file_lines()
  File "/usr/local/lib/python3.10/site-packages/copilot/history_file.py", line 41, in zsh_history_file_lines
    lines = history.read().splitlines()
  File "/usr/local/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbc in position 2703: invalid start byte