Fluentterminal: CLI arguments

Created on 2 Oct 2018  路  8Comments  路  Source: felixse/FluentTerminal

The context menu integration is great. However, when I tried to configure it as a externel terminal of VSCode it failed. (VSCode setting "terminal.external.windowsExec": "C:\\Users\\<username>\\AppData\\Local\\Microsoft\\WindowsApps\\flute.exe")

Currently, it seems that we are using flute.exe new <path> to start a terminal with a given path. I guess VSCode assumes it is flute.exe <path>. Shall we adopt this scheme?

enhancement

All 8 comments

Guess this would be fine, if VSCode expects it that way it might be a convention I didn't know or think about.

Just had a look at this. Seems like vscode is not passing any directory at all. Maybe we should create an issue at vscode to allow passing some arguments to the external terminal. However, I don't think we can do anything on our side right now.

Thanks. I assumed it because I found "cmder" works well with vscode and it accepts path argument right after cmder.exe.

So I had a look at the vscode source code just now and found that's because vscode made an adaption to cmder 馃槀. Here is the code.

When vscode finds the external terminal is cmder, it opens it with spawner.spawn(exec, [cwd]); (line 87) while exec is the path to cmder.
Otherwise, vscode opens terminal with spawner.spawn(command, cmdArgs, env); (line 101) and cwd is set in the env variable.

Could we leverage the env variable?

The environment is actually the standard way that most things know where to start, and it is bidirectional in some cases too. Here's an example of how most Unix tools obey the PWD environment variable:

Michael@Prometheus ~
$ env | grep PWD
PWD=/home/Michael

Michael@Prometheus ~
$ PWD=/tmp

Michael@Prometheus /tmp
$ cd /var

Michael@Prometheus /var
$ echo $PWD
/var

It seems that "Open Fluent Terminal Here" no long works in v0.2.1.0

Terminal always starts with the user home.

(Windows Insider 18267)

I ended up working around this by creating a batch file in the same directory as flute.exe with the following contents, and setting _that_ as the external terminal:

flute.exe new %cd%
exit

_EDIT: %cd% above was previously %~dp0... I must have been tired..._

I'm not sure why, but when I set the VS Code external terminal to flute.exe, the app launched but a terminal never actually opened -- Fluent just hung on the green >_ splash screen.

@Kage-Yami that didn't quite work for me - it always launched the terminal in the directory of flute.exe, which isn't what I wanted. When I changed the first line to flute.exe new %CD%, however, it worked.

I wish there were a good way to make this work without momentarily launching cmd.exe :(

This is working now. Just configure flute.exe as external terminal. It will open a new terminal with the default profile in the directory that is opened in vscode.

Please note that further arguments are not supported, as discussed here: https://github.com/microsoft/vscode/issues/58086

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SheepDomination picture SheepDomination  路  6Comments

TomerZeitune picture TomerZeitune  路  6Comments

DRSDavidSoft picture DRSDavidSoft  路  7Comments

Loreno10 picture Loreno10  路  5Comments

Sharlaan picture Sharlaan  路  6Comments