Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support typing/pasting tabs into the chat in all terminal environments #502

Open
kripper opened this issue Mar 11, 2024 · 8 comments
Open
Labels
enhancement New feature or request

Comments

@kripper
Copy link

kripper commented Mar 11, 2024

I see no way to copy & paste blocks containing tabs into the prompt.
Multiline mode doesn't work either.
session.prompt() is ignoring the tabs (they get lost and the context gets corrupted).

Aider v0.26.1-dev
VSCode terminal detected, pretty output has been disabled.
API key supports: gpt-3.5-turbo, gpt-3.5-turbo-0301, gpt-3.5-turbo-0613, gpt-3.5-turbo-16k, 
gpt-3.5-turbo-16k-0613, gpt-4, gpt-4-0314, gpt-4-0613
API key does not support gpt-4-1106-preview, falling back to gpt-3.5-turbo-0125
Model: gpt-3.5-turbo-0125 using whole edit format
Git repo: .git with 3 files
Repo-map: using 1024 tokens
kripper added a commit to kripper/aider that referenced this issue Mar 11, 2024
@paul-gauthier
Copy link
Owner

Thanks for trying aider and filing this issue.

Pasting in tabs works just fine in my local Mac environment. There may be a problem with your terminal environment?

$ aider
Aider v0.26.2-dev
Model: gpt-4-1106-preview using udiff edit format
Git repo: .git with 0 files
Repo-map: using 1024 tokens
Use /help to see in-chat commands, run with --help to see cmd line args
───────────────────────────────────────────────────────────────────────────────────────────────
> what seperator is used in the following text: hello^Iworld^I!
cola^Icolb^Icolc


The separator used in the provided text is a tab character, often represented as \t in many
programming languages. This character is used to separate columns in tab-delimited text files
or strings.

@paul-gauthier paul-gauthier added the question Further information is requested label Mar 11, 2024
@kripper
Copy link
Author

kripper commented Mar 11, 2024

Pasting in tabs works just fine in my local Mac environment. There may be a problem with your terminal environment?

Hi. I tested on Windows.
I noticed the issue on the standard terminal, and then debugged the input inside visual code. There was no \t.

Did you try tabs or spaces?

I believe the tabs are ingested by PromptSession for the commands autocompleter (with the tab key).
How does the stdin reader on Mac distinguish between pasted tabs and tabs pressed on the keyboard if both are merely tabs on stdin?

There is also another use case where pasting multiline text that does not begin with { is required.

@paul-gauthier
Copy link
Owner

I pasted tabs, worked fine. It looks like you are running aider inside the VSCode terminal, which is known to not be a fully functional terminal. That could be part of the issue.

Also, using { to start a multi-line paste is not intended to handle "text that starts with {". It's intended as a way to wrap any multi-line text you wish to enter into the chat.

@kripper
Copy link
Author

kripper commented Mar 12, 2024

I tested again in a normal cmd.exe window and confirmed that the tabs are lost.
In general pressing the tab key doesn't generate any output.
It does only autocomplete commands after entering /.

@paul-gauthier
Copy link
Owner

What are you trying to accomplish? Why are you trying to type bare tabs into the chat window?

@kripper
Copy link
Author

kripper commented Mar 20, 2024

What are you trying to accomplish? Why are you trying to type bare tabs into the chat window?

Yes. I have a prompt containing a JSON indented with tabs and I'm doing copy/paste. It could also be a prompt with python code.

@paul-gauthier
Copy link
Owner

As I mentioned above, pasting in tabs works just fine in my local Mac environment. There may be a problem with your terminal environment? Especially if you're in the VS Code terminal.

Also, JSON doesn't need tabs?

Another solution could be to make a file with the JSON and /add it to the chat and then reference it in your chat. "Use the JSON in foo.json to do blah blah blah".

@kripper
Copy link
Author

kripper commented Mar 23, 2024

I'm testing inside a normal cmd.exe window on Windows 10.
If you are testing on a Mac, I guess pasting tabs only works on Mac.
I prefer clean and general solutions. That's why I also mentioned pasting python code where tabs are important.
I will be using the /block command I implemented in https://github.com/paul-gauthier/aider/pull/504/files
Thanks.

@paul-gauthier paul-gauthier added enhancement New feature or request and removed question Further information is requested labels Apr 11, 2024
@paul-gauthier paul-gauthier changed the title Support tabs in the prompt Support typing/pasting tabs into the chat in all terminal environments Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants