Saadmairaj / tkterminal

Terminal widget for Tkinter library.
https://pypi.org/project/tkterminal
Apache License 2.0
57 stars 6 forks source link

FileNotFoundError: [Errno 2] No such file or directory: 'echo "hi"'' #12

Open BitPigeon opened 2 years ago

BitPigeon commented 2 years ago

This project is awesome! As far as I am aware there is only one error: When I try to run echo "hi" or any other [two word] command while not in shell mode, it returns

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.9/threading.py", line 892, in run
    self._target(*self._args, **self._kwargs)
  File "/home/therealpenguin/.local/lib/python3.9/site-packages/tkterminal/utils.py", line 43, in wrapper
    kw['return'] = kw['function'](*args, **kwargs)
  File "/home/therealpenguin/.local/lib/python3.9/site-packages/tkterminal/ternimal.py", line 157, in _run_on_return
    with Popen(cmd, stdout=PIPE, stderr=PIPE, stdin=stdin,
  File "/usr/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.9/subprocess.py", line 1823, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'echo "hi"'
BitPigeon commented 2 years ago

In my experience this means Popen() is used with a string: 'echo "hi"' rather than a list: ['echo', '"hi"].