microsoft / microsoft/vscode-cmake-tools

C++ Compile Active File - doesn't work (Win 7)

Open
#1,227 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement Feature: build
Dominant language
TypeScript
Stars
1.7k
Forks
546
Avg merge
2d 16h
Merged PRs (30d)
32

Description

VSCode Version: 1.44.2
C/C++ Version 0.27.1
OS Version: Windows_NT x64 6.1.7601

Steps to Reproduce:

  1. Install Extensions: C/C++; CMake; CMake Tools
  2. Select compiler: e.g. Visual Studio Professional 2019 - x86
  3. Open and build any suitable CMake project. (This works no problems for me).
  4. Open any C++ file in that project, and select "Compile Active File (Ctrl+F7)
  5. Terminal window opens with a command prompt but nothing else happens. Active file is not compiled.

I think the issue is limited to Win7. My colleague has Win10 and Compile_Active_File works fine for him.

I think the problem is that Compile_Active_File is trying to paste a long compile command into the terminal but this is not working. (I found a VSCode issue reported that just pasting long text into terminal does not work)

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.

I wondered if a possible fix/workaround would be to send the command to the terminal in smaller chunks.

Note: I initially reported this issue in VSCode repository ([https://github.com/microsoft/vscode/issues/96860]), but they suggested it was a C++ issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue on Windows 7 using the listed CMake Tools setup and the Compile Active File command. Start by tracing how that command sends the long compile line to the terminal; done means the active C++ file compiles successfully, including when the command is longer than the terminal accepts in one paste.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system, operating-systems, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.