Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve #12 temporarily #28

Merged
merged 1 commit into from
Oct 30, 2018
Merged

Resolve #12 temporarily #28

merged 1 commit into from
Oct 30, 2018

Conversation

andylizf
Copy link
Contributor

No description provided.

@danielpinto8zz6
Copy link
Owner

it only works for windows?

@andylizf
Copy link
Contributor Author

andylizf commented Oct 28, 2018

I think all this project only works on Windows now, actually.

@andylizf
Copy link
Contributor Author

andylizf commented Oct 28, 2018

There's no "start" command in Linux or Mac. And judging which terminal available is difficult.

@danielpinto8zz6
Copy link
Owner

Sorry, I've been busy, I'll merge that soon as possible.
Thanks

@danielpinto8zz6
Copy link
Owner

danielpinto8zz6 commented Oct 29, 2018

so, I came up with an idea, vscode has the following settings :

// Customizes which terminal to run on Linux.
"terminal.external.linuxExec": "xterm",

// Customizes which terminal application to run on macOS.
"terminal.external.osxExec": "Terminal.app",

// Customizes which terminal to run on Windows.
"terminal.external.windowsExec": "C:\Windows\System32\cmd.exe"

so, we can use that setting to get the terminal and that way we can support all platforms

@andylizf
Copy link
Contributor Author

I also thought of this idea. But Linux itself doesn't have a "start" command, and how to implement the "start" command is terminal emulators' own business. We can't always know which option can create a new instance. For example, zsh requires -t, gnome-terminal requires -x, and even some strange terminals don't have this feature at all. It depends on itself.

@danielpinto8zz6
Copy link
Owner

well, I already found a way xD
gnome-terminal -e 'sh -c "echo test; read -n1 -p "Press any key to continue...""'

@andylizf
Copy link
Contributor Author

But if I use xterm and I haven't gnome-terminal?

@danielpinto8zz6
Copy link
Owner

It works too

@andylizf
Copy link
Contributor Author

andylizf commented Oct 29, 2018

But it isn't "-e", it's another option in xterm.

@danielpinto8zz6
Copy link
Owner

I tested myself... Im linux user

@andylizf
Copy link
Contributor Author

Cover my face. 😅 Very Embarrassing.

@danielpinto8zz6
Copy link
Owner

So, for mac I dont know, because I cant test xd

@andylizf
Copy link
Contributor Author

Ok……

@andylizf
Copy link
Contributor Author

So it is ${terminalConfiguration.get<string>("linuxExec")} -e 'sh -c "${command}; read -n1 -p "Press any key to continue...""'

@andylizf
Copy link
Contributor Author

In fact, I already made what you say yesterday, but it's not consummate, which has not been completely successful on my classmate's ubuntu virtual machine.

so, I came up with an idea, vscode has the following settings :

// Customizes which terminal to run on Linux.
"terminal.external.linuxExec": "xterm",
// Customizes which terminal application to run on macOS.
"terminal.external.osxExec": "Terminal.app",
// Customizes which terminal to run on Windows.
"terminal.external.windowsExec": "C:\Windows\System32\cmd.exe"

so, we can use that setting to get the terminal and that way we can support all platforms

@danielpinto8zz6
Copy link
Owner

So, we have to rework that,
like, we don't need to use the vscode terminal, if we're launching os specific console we shouldn't call vscode terminal, we can do it by spawn command...
for mac I saw that we can make it work with osascript, I have no way to test it

@andylizf
Copy link
Contributor Author

andylizf commented Oct 29, 2018

I think the opposite is true. We can change the settings, just like the JS template string lets the user set the command with variables. Like you said
"c-cpp-compile-run.run-command" = "gnome-terminal -e 'sh -c "${outputFile}; read -n1 -p "Press any key to continue...""'"
Then we getSetting<string>(key.runCommand).replace("${outputFile}", outputFile) and run again.

@andylizf
Copy link
Contributor Author

andylizf commented Oct 29, 2018

I will implement it in the dev branch, in the foreseeable future...
And I think this can be merged to master to fix #12 temporarily.

@danielpinto8zz6
Copy link
Owner

Yes agree

@andylizf andylizf merged commit e120f99 into danielpinto8zz6:master Oct 30, 2018
@danielpinto8zz6
Copy link
Owner

f178b9d needs to be tested in windows & mac.
actually on linux it only supports gnome terminal and xterm

@danielpinto8zz6
Copy link
Owner

7be5d73

@danielpinto8zz6
Copy link
Owner

Confirmed working on linux & windows, still need to be tested on mac

@LazyRen
Copy link
Contributor

LazyRen commented Apr 12, 2019

Hi, I'm currently using this plugin in mac environment. Sadly current version does not works for external Terminal app. I created pull request to fix it. Hope it helps!

p.s. It only works for Terminal.app. 'iTerm' is not supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants