Code Runner란?
코드 편하게 실행할 수 있도록 도와주는 확장 프로그램으로 다양한 언어를 지원하고 있습니다.
Code Runner 설치하기
Code Runner Extension 설치하기

VScode] Extension(Ctrl + Shift + X) -> Code Runner 검색 -> install
Code Runner 설정하기
● 키보드 입력을 받는 경우 Code Runner가 작동하지 않는 문제가 발생할 수 있습니다. 이는 출력이 VScode 출력 탭에서 출력되기 때문으로 이를 해결하기 위해서는 출력을 터미널에서 수행하도록 설정을 하여 문제를 해결할 수 있습니다.
터미널에서 실행되도록 설정하기


code-runner terminal 입력 -> Code-runner: Run In Terminal 체크
Code Runner 변수 경로 설정

code runner 입력 -> Edit in settings.json 선택

code-runner.executorMap 안에 각 언어에 해당하는 컴파일러 경로 설정
● Code Runner 실행시 Window 10환경에서는 Default Shell이 Power shell이므로 이를 cmd로 변경 및 cmd 인코딩으로 인해 한글이 깨지는 문제가 발생할 수 있습니다. 이를 해결하기 위해 아래와 같이 설정합니다.
Default Shell 변경 및 한글 깨짐 해결

code-runner.executorMap 안에 "terminal.integrated.shell.windows": "cmd.exe", 내용 추가
"code-runner.executorMap": {
"terminal.integrated.shell.windows": "cmd.exe",
한글 깨짐 문제 해결

code-runner.executorMap 안에 "terminal.integrated.shellArgs.windows":["/K", "chcp 65001"], 내용 추가
"terminal.integrated.shellArgs.windows":["/K", "chcp 65001"],
Code Runner 실행

단축키
실행 : Ctrl + Alt + N
실행중지 : Ctrl + Alt + M
언어선택 : Ctrl + Alt + J
참고 1. VS Code(Visual Studio Code) |
'Coding' 카테고리의 다른 글
절대경로와 상대경로 (0) | 2021.05.22 |
---|---|
전처리기 《Preprocessor》 (0) | 2021.05.21 |
[Source Code Editor] VS Code《Visual Studio Code》 (0) | 2021.03.13 |