소스 검색

Adds terminal.overrideGitEditor setting

main
Nafiur Rahman Khadem 2 년 전
committed by Eric Amodio
부모
커밋
4e999e52c2
4개의 변경된 파일16개의 추가작업 그리고 2개의 파일을 삭제
  1. +1
    -0
      CHANGELOG.md
  2. +7
    -0
      package.json
  3. +3
    -0
      src/config.ts
  4. +5
    -2
      src/terminal.ts

+ 1
- 0
CHANGELOG.md 파일 보기

@ -24,6 +24,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
- Changes SHA terminal links to use the _Commit Details_ view — closes [#2320](https://github.com/gitkraken/vscode-gitlens/issues/2320)
- Adds a `gitlens.terminalLinks.showDetailsView` setting to specify whether to show the _Commit Details_ view when clicking on a commit link
- Changes to uses VS Code as Git's `core.editor` for terminal run commands — closes [#2134](https://github.com/gitkraken/vscode-gitlens/pull/2134) thanks to [PR #2135](https://github.com/gitkraken/vscode-gitlens/pull/2135) by Nafiur Rahman Khadem ([@ShafinKhadem](https://github.com/ShafinKhadem))
- Adds a `gitlens.terminal.overrideGitEditor` setting to specify whether to use VS Code as Git's `core.editor` for Gitlens terminal commands
### Fixed

+ 7
- 0
package.json 파일 보기

@ -2692,6 +2692,13 @@
"markdownDescription": "Specifies whether to show the _Commit Details_ view when clicking on a commit link in the integrated terminal",
"scope": "window",
"order": 20
},
"gitlens.terminal.overrideGitEditor": {
"type": "boolean",
"default": true,
"markdownDescription": "Specifies whether to use VS Code as Git's `core.editor` for Gitlens terminal commands",
"scope": "window",
"order": 100
}
}
},

+ 3
- 0
src/config.ts 파일 보기

@ -154,6 +154,9 @@ export interface Config {
};
};
};
terminal: {
overrideGitEditor: boolean;
};
terminalLinks: {
enabled: boolean;
showDetailsView: boolean;

+ 5
- 2
src/terminal.ts 파일 보기

@ -1,5 +1,6 @@
import type { Disposable, Terminal } from 'vscode';
import { window } from 'vscode';
import { configuration } from './configuration';
import { Container } from './container';
import { getEditorCommand } from './system/utils';
@ -28,6 +29,8 @@ function ensureTerminal(): Terminal {
export function runGitCommandInTerminal(command: string, args: string, cwd: string, execute: boolean = false) {
const terminal = ensureTerminal();
terminal.show(false);
const editor = getEditorCommand();
terminal.sendText(`git -C "${cwd}" -c "core.editor=${editor}" ${command} ${args}`, execute);
const coreEditorConfig = configuration.get('terminal.overrideGitEditor')
? `-c "core.editor=${getEditorCommand()}" `
: '';
terminal.sendText(`git -C "${cwd}" ${coreEditorConfig}${command} ${args}`, execute);
}

불러오는 중...
취소
저장