PentestGPT icon indicating copy to clipboard operation
PentestGPT copied to clipboard

Unable to use <SHIFT + right arrow> Feature

Open HelloHowAreYouNow opened this issue 1 year ago • 12 comments

I am currently attempting to run PentestGPT in Kali Linux. However, I seem to be encountering issues with the <Shift + Right Arrow> feature, which is used to select an item and move to the next line. I am stuck at the input section below and cannot select anything to enter my input. This is preventing me from proceeding to the next step as the <Shift + Right Arrow> function does not seem to be working.

image

HelloHowAreYouNow avatar May 02 '23 08:05 HelloHowAreYouNow

Thanks for reporting this. I'll try to reproduce the issue and see if there's any solution.

GreyDGL avatar May 02 '23 08:05 GreyDGL

Same issue here. Running Terminal on macOS Big Sur (11.7.6). Using ZSH (which I suspect to be the issue). If I find a solution/fix, will post it here.

Edit: Works after switching from zsh to Bash (/bin/bash).

topscoder avatar May 03 '23 08:05 topscoder

@topscoder Interesting. I'm using the same environment as you. For me, the current key combination works. Anyway I'll try to reproduce this issue on Kali first and see how to resolve it.

GreyDGL avatar May 03 '23 08:05 GreyDGL

Maybe it's Oh My Zsh in my case. I'm using it and it seems its overriding some keybindings.

topscoder avatar May 03 '23 08:05 topscoder

Seem to run into the same issue for both bash and zsh for kali. I am currently using Kali (2023.1)

HelloHowAreYouNow avatar May 03 '23 08:05 HelloHowAreYouNow

Same issue here, tried both mac os x and kali, tried zsh and bash. No luck.

ignazio-castrogiovanni avatar May 05 '23 04:05 ignazio-castrogiovanni

Same issue bash env, kali wonder if its keyboard env.

ante1377 avatar May 05 '23 15:05 ante1377

same issue, vmware kali zsh, wsl kali too

ibndias avatar May 06 '23 02:05 ibndias

I reproduced the issue in Kali. Will develop a fix. Meanwhile I cannot reproduce the issue on MacOS. If someone encounter the same issue, please ping me with your system setting.

GreyDGL avatar May 06 '23 06:05 GreyDGL

The shift + arrow keys don't appear to be passed to kali when using vmware+macos+kali This can be tested by running od -i in the terminal and then hitting the keyboard shortcut

I changed lines 39 and 74 on my utils/prompt_select.py file from 's-right' to 'right' and it works just fine (then just use right-arrow, not shift + right-arrow)

you can see what the python prompt toolkit maps these to here - https://github.com/prompt-toolkit/python-prompt-toolkit/blob/master/src/prompt_toolkit/input/ansi_escape_sequences.py

EDIT: Additionally, a list of of keyboard shortcuts mapped to how to write them in code for prompt toolkit (e.g c-a for ctrl+a) is shown here - https://python-prompt-toolkit.readthedocs.io/en/master/pages/advanced_topics/key_bindings.html#list-of-special-keys

jtothef avatar May 06 '23 07:05 jtothef

Thanks @jtothef ! I use a two-key binding because I don't want to arbitrarily trigger to enter. This seems to be valid solution. I'll develop a key binding conf so that people can set it freely.

Edit: one issue might be that users may want to use arrow keys to move the cursor and modify the typed contents. A configurable key-binding would be better.

GreyDGL avatar May 06 '23 07:05 GreyDGL

The shift + arrow keys don't appear to be passed to kali when using vmware+macos+kali This can be tested by running od -i in the terminal and then hitting the keyboard shortcut

I changed lines 39 and 74 on my utils/prompt_select.py file from 's-right' to 'right' and it works just fine (then just use right-arrow, not shift + right-arrow)

you can see what the python prompt toolkit maps these to here - https://github.com/prompt-toolkit/python-prompt-toolkit/blob/master/src/prompt_toolkit/input/ansi_escape_sequences.py

Solution tested in Kali,Hyper-V works perfectly.

ante1377 avatar May 06 '23 08:05 ante1377

Running into the same issue running Kali (Purple 2023.3) in MacOS Monterey 12.6.7 Can somebody provide step by step remediation? Thank you

oneofmany avatar Sep 09 '23 15:09 oneofmany

I also faced this problem on Kali, maybe it will be useful for someone:

  1. You need to find the file "prompt_select.py" in the installation directory PentestGPT. In my case it is - "/home/user/PentestGPT/PentestGPT/pentestgpt/utils/prompt_select.py".
  2. Edit the values in this file 's-right', if it is replaced by a value 'right then the selection of the menu item will be activated when is pressed the button "->".

vniverskyi avatar Dec 16 '23 08:12 vniverskyi

The easiest fix for this issue is to use tmux in Kali Linux, as mentioned in the latest version of documentation. Instead of using the native terminal, you may type tmux to enter a tmux terminal, and everything will be working as expected.

GreyDGL avatar Dec 16 '23 10:12 GreyDGL