Skip to content

Commit b464829

Browse files
authored
Merge commit from fork
See the advisory for more details.
1 parent 3dcaf17 commit b464829

File tree

1 file changed

+6
-24
lines changed

1 file changed

+6
-24
lines changed

src/commandsAndMenu.tsx

+6-24
Original file line numberDiff line numberDiff line change
@@ -164,31 +164,13 @@ export function addCommands(
164164
label: trans.__('Open Git Repository in Terminal'),
165165
caption: trans.__('Open a New Terminal to the Git Repository'),
166166
execute: async args => {
167-
const main = (await commands.execute(
168-
'terminal:create-new',
169-
args
170-
)) as MainAreaWidget<ITerminal.ITerminal>;
167+
const cwd = gitModel.pathRepository;
168+
const main = (await commands.execute('terminal:create-new', {
169+
...args,
170+
cwd
171+
})) as MainAreaWidget<ITerminal.ITerminal>;
171172

172-
try {
173-
if (gitModel.pathRepository !== null) {
174-
const terminal = main.content;
175-
terminal.session.send({
176-
type: 'stdin',
177-
content: [
178-
`cd "${gitModel.pathRepository
179-
.split('"')
180-
.join('\\"')
181-
.split('`')
182-
.join('\\`')}"\n`
183-
]
184-
});
185-
}
186-
187-
return main;
188-
} catch (e) {
189-
console.error(e);
190-
main.dispose();
191-
}
173+
return main;
192174
},
193175
isEnabled: () =>
194176
gitModel.pathRepository !== null &&

0 commit comments

Comments
 (0)