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
Can't call sendText API or paste into terminal with long text #38137
Comments
How long does the path get before it starts to truncate? Is there a pattern to it? |
The only pattern I can see is that the text gets cropped after 1018 characters, but only if that's the very first text being sent to the terminal, otherwise it works fine. |
Also happens with pasting apparently #63613 |
#sendText
with a long text
I think this bug is preventing "CMake: Compile File" from working for me. Selecting this command just switches to the TERMINAL window and nothing happens. If I try pasting the command line in manually (1562 chars long) nothing happens. If I paste the command in 2 pieces, it works as expected. Windows 7. |
Downstream impacts using VS Code for Python development, definitely makes it challenging to use VS Code for me. :( |
Any update on this? |
I had all these errors (there is a family of pasting to terminal/interactive python over ssh) as of about June/July, but just retested with August update and none of them replicate (did 3 of them). For example the big paste 99 lines of python bug report replicated for me in June/July, but now it does not. Did these get quitely get fixed somewhere? Anyway. Send text to terminal bugs seem to have went away for me. E.g. send text to terminal works just fine for me with this:
|
@gowerc I also work in a data science related field (bioinformatics) and this issue is the only thing keeping me from switching from Sublime Text to VS Code. I do hope more people chime in so it can get resolved. Platforms like RStudio and Spyder have had this functionality since their inception, but are unfortunately tied to a single language. |
I work in data science, and typically when I am operating this way I am writing the .py file for long term use on a remote machine and/or just trying to get to result as rapidly as possible on a remote machine. In your scenario, I would have to commit, push, pull on a remote machine, rerun, and carefully isolate the state of the environment I wanted to test or let it run, see what line number broke, go to my code fix the line number, commit, push, pull, rerun. See what line number broke, go to my code fix the line number, commit, push, pull, rerun. Or I can open competitor IDE, send to terminal until I get to the tricky stuff to write, and code line by line until the .py file is correct, and commit, push pull, rerun once because I interactively verified the code works the first time. That is why. |
I cared enough about this to start reverting vscode versions, and I thought with a little bit of care I could help some by treating it like a by-hand regression testing. Regarding the test at #96973 This version has the correct behavior: FebLast version that works correctly on this issue. File https://update.code.visualstudio.com/1.43.2/darwin/stable Version Info Version: 1.43.2 Result (base) <user>$ echo "hello, world" # 036
hello, world
(base) <user>$ echo "hello, world" # 037
hello, world
(base) <user>$ echo "hello, world" # 038
hello, world
(base) <user>$ echo "hello, world" # 039
hello, world
(base) <user>$ echo "hello, world" # 040
hello, world
(base) <user>$ echo "hello, world" # 041
hello, world
(base) <user>$ echo "hello, world" # 042
hello, world
(base) <user>$ echo "hello, world" # 043 MarchThe March file does not have the correct behavior. File https://update.code.visualstudio.com/1.44.2/darwin/stable Version Result AprilThe April file does not have the correct behavior. File https://update.code.visualstudio.com/1.45.0/darwin/stable Result |
Hey @jrounds & @diazdc I've found a workaround that solves this problem (though I stress its a workaround so would be great to get an official solution). The extension R ( ikuyadeu.r by Yuki Udeda) has the command keybindings.json :
|
I seem to be getting this when running a shell task (which runs python behave) -- output is truncated when there is a lot of it. (which is just when I need it -- I turn on some diagnostic so I can debug, and suddenly the whole test case output is truncated :/) |
Anyone still experiencing this please share your OS+version, perhaps this was an old Mac/Linux upstream bug that has since been fixed? |
System Version: macOS 10.14.6 (18G3020) But note my post above it goes away for me in older versions of vscode on this same OS. I guess that could still be consistent with an upstream bug =/ |
I am having this issue, I am using Windows 10 version 1903 (build 18362.836) and the latest version of VScode (1.45.1) I can paste long text fine, I just can't print it to terminal, when i do it cuts off midway. I have tried changing the Text Output Limit in the Python extension settings but it doesn't make a difference. It prints fine when I run in the Python terminal outside of VScode. |
I've still got this issue :( Version: 1.45.1 Mojave 10.14.6 (18G4032) |
@Tyriar I'm happy to connect with you to troubleshoot this if it would be helpful, I'm still able to reproduce this.
|
I'm still not able to reproduce and just worked through the issue with @DougPlumley and it looks like we came up with a solution. Unfortunately it involves timeouts and magic numbers as it appears the underlying issue is some race condition around writing to file descriptors in either node.js or Linux. The workaround involves disallowing "large writes" (> 50 chars) and instead spacing them out (by 5ms). I see at least someone reproduced the issue in Windows as well which may be something else, but regardless the workaround to space out writes also applies there. Thanks @DougPlumley! |
Marking verified since it seems to work for me on Linux, OSX, and Windows, though I see there were reproduction issues historically... |
@connor4312 yeah I could never repro this. @DougPlumley it would be great if you could tell us if it's working now for you on Insiders. |
Looks like insider works again for me (same test mentioned above). Version: 1.49.0-insider |
I can't reproduce it anymore even if I massively scale up to 10K+ characters, this is awesome! Thank you! |
It still doesn't work for me on Win7 - there is still some threshold above which can't be pasted into Terminal: Version: 1.48.2 (user setup) |
@Tyriar Thanks - I had no idea about insiders. Version: 1.49.0-insider (user setup) |
I just found out that I can't call
terminal.sendText
with a text as long as the following one, because it gets cropped:I found out about this issue because I'm coding a little function that given N paths it opens them in a new VSC window as an unnamed workspace, and for doing so it's building a command that looks like this:
code path1 && code --add path2 && (...) code --add pathN
.I can't even split this particular command into smaller ones because of #38138.
Why is there even this limitation?
The text was updated successfully, but these errors were encountered: