question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Run Selection/Line in Python Terminal limits number of characters sent to terminal

See original GitHub issue

Environment data

  • VS Code version: 1.30.2
  • OS and version: Windows 7
  • Python version (& distribution if applicable, e.g. Anaconda): 3.7.1

Expected behaviour

sql variable is assigned string of 1,589 “a” characters over 16 lines when selecting “Run Selection/Line in Python Terminal”

Actual behaviour

Nothing. If there are less characters (1,467 total) I can run the selection to the terminal. I can run this in the anaconda prompt and spyder IDE just fine.

Additionally, when I use the debugger, the program runs just fine and assigns the sql variable.

Lastly, I’ve run this on other Win7 computers, with the same result. On Win10, there was not an issue.

Steps to reproduce:

Create a .py file with the follow variable assignment.

sql = """
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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minal” or
  2. highlight and “Shift + Enter” or
  3. Copy and paste in python terminal in vscode

Logs

No action.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ericsnowcurrentlycommented, Feb 26, 2019

The root cause is not clear. However, given that it is limited to Windows 7 which is soon to be EOL (and which was no longer going to affect the original user), I didn’t see the value in proceeding.

Regardless, I’ve opened https://github.com/Microsoft/vscode/issues/69470 upstream.

0reactions
DonJayamannecommented, Feb 27, 2019

Closing again,

Read more comments on GitHub >

github_iconTop Results From Across the Web

Character/line limit when pasting in vscode terminal
I'm on Windows 7, VSCode 1.8.1, ionide-fsharp 2.21.0, F# 4.0. Newlines count as 2 characters (\r\n). Writing down these numbers, apparently ...
Read more >
Terminal does not accept pasted or typed lines of more than ...
This is a badly phrased question. In the Z shell the limit is not 1024 characters. You're actually talking about a limit that...
Read more >
1. Command line and environment — Python 3.11.1 ...
Execute the Python code contained in script, which must be a filesystem path (absolute or relative) referring to either a Python file, a...
Read more >
Linux command line character limit - Server Fault
The shell/OS imposed limit is usually one or two hundred thousand characters. getconf ARG_MAX will give you the maximum input limit for a...
Read more >
Python Command Line Arguments
Take good note of the parameters: argc is an integer representing the number of arguments of the program. argv is an array of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found