opensouls / terminal-copilot

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

No "alias" support for Ubuntu #1

Closed gitlost-murali-askui closed 1 year ago

gitlost-murali-askui commented 1 year ago

Suggestion:

subprocess.run(['bash', '-c', '-i', 'alias'], capture_output=True) in a try catch block with {subprocess.run(["alias"], capture_output=True).stdout.decode("utf-8")}

Traceback (most recent call last):

File "/home/mano/anaconda3/envs/cpenv/lib/python3.9/site-packages/copilot/copilot.py", line 44, in main {subprocess.run(["alias"], capture_output=True).stdout.decode("utf-8")} File "/home/mano/anaconda3/envs/cpenv/lib/python3.9/subprocess.py", line 505, in run with Popen(*popenargs, **kwargs) as process: File "/home/mano/anaconda3/envs/cpenv/lib/python3.9/subprocess.py", line 951, in init self._execute_child(args, executable, preexec_fn, close_fds, File "/home/mano/anaconda3/envs/cpenv/lib/python3.9/subprocess.py", line 1821, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'alias'

gitlost-murali-askui commented 1 year ago

Pull request added https://github.com/Methexis-Inc/terminal-copilot/pull/2