Skip to content

Ctrl+C not working in Windows #231

@Atsui75

Description

@Atsui75

Describe the bug
I have been trying to make Open Interpreter 01 run in my windows machine. I'd like to share my small findings so far, in case they can be of any help. I apologize beforehand for my inexperience in broadcasting my findings, I am not very familiar with github, but I really want this project to be as good as it can.

Afer initializing 01 in windows the command Ctrl+C does not work.

I think I have discovered the reason:
In software/source/clients/base_device.py, line 256, the keys checked to stop program execution are
keyboard.Key.ctrl and keyboard.KeyCode.from_char("c").

In my machine the key registered when pressing the left control corresponds to: keyboard.Key.ctrl_l (I also had to test if ctrl_l and c are in pressed keys separatedly: if ctrl_l in pressed keys and c in pressed keys: ...)

If I change this, Ctrl+C starts working, but the program gives a new error, which I think is due to windows not having the same process-killing method as linux or Mac:

Unhandled exception in listener callback
Traceback (most recent call last):
File "C:\Users\santi\AppData\Local\pypoetry\Cache\virtualenvs\01os-NWxsdfXh-py3.11\Lib\site-packages\pynput_util_init_.py", line 228, in inner
return f(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\santi\AppData\Local\pypoetry\Cache\virtualenvs\01os-NWxsdfXh-py3.11\Lib\site-packages\pynput\keyboard_win32.py", line 287, in process
self.on_press(key)
File "C:\Users\santi\AppData\Local\pypoetry\Cache\virtualenvs\01os-NWxsdfXh-py3.11\Lib\site-packages\pynput_util_init
.py", line 144, in inner
if f(*args) is False:
^^^^^^^^
File "C:\Users\santi\Desktop\Proxectos\01\software\source\clients\base_device.py", line 267, in on_press
kill_process_tree()
File "C:\Users\santi\Desktop\Proxectos\01\software\source\server\utils\process_utils.py", line 10, in kill_process_tree
os.killpg(os.getpgid(pid), signal.SIGKILL)
^^^^^^^^^
AttributeError: module 'os' has no attribute 'killpg'

Thank you for this amazing project. I will try to keep researching in order to make this tool work in my computer.

If I am doing something wrong or if somebody has already solved this issues in windows I'd love any help or suggestion.

Thank you in advance :)

Desktop (please complete the following information):

  • OS: Windows
  • Python Version 3.11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions