Skip to content

VSCode becomes unresponsive after pasting filename with many dots in file tree #116199

@ghost

Description

  • VSCode Version: 1.53.0 (commit id: 8490d3d)
  • OS Version: Ubuntu 20.04.2 LTS (Kernel: Linux 5.4.0-65-generic)

I stumbled upon this bug by accident when I had the contents of some large file in my clipboard and (not realizing I had these file contents in the clipboard) when I pasted it in the filename of the file explorer of VSCode, it became unresponsive to the point I had to force kill it. In my opinion it is not very critical, not many people with encounter this issue, it was just surprising that my vscode became unresponsive due to this. I tried to locate the source of the issue in the code, but I couldn't find it myself.

Steps to Reproduce:

  1. open a directory in VSCode such that you have some file existing in the Explorer
  2. copy some filename with many dots to the clipboard. I use python -c "print('a.' * 50000)" | xclip -sel clip for this
  3. select the file and click rename F2, followed by CTRL-V to paste the string
  4. observe vscode is unresponsive for more than 30 seconds, after which I force kill it.

I found out that when you would paste 100.000 characters without using dots (i.e. python -c "print('ab' * 50000)" | xclip -sel clip), then VSCode responds very quickly and lets me know the filename is invalid.

Since the maximum allowed length of a filename is 255 characters, I think it would suffice to limit the filename to 255 characters before any further parsing is done.

Does this issue occur when all extensions are disabled?: Yes / no

Metadata

Metadata

Assignees

Labels

author-verification-requestedIssues potentially verifiable by issue authorbugIssue identified by VS Code Team member as probable bugfreeze-slow-crash-leakVS Code crashing, performance, freeze and memory leak issueshelp wantedIssues identified as good community contribution opportunitiesinsiders-releasedPatch has been released in VS Code InsidersverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions