Giter Club home page Giter Club logo

vscode-terminal-here's Introduction

Exposes the command terminalHere.create that creates a terminal at the current file's directory. This can be accessed through the command palette (ctrl/cmd+shift+p) or by attaching a custom keybinding to it.

vscode-terminal-here's People

Contributors

drsdavidsoft avatar dyong1 avatar guivho avatar saaketp avatar tyriar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

vscode-terminal-here's Issues

can't open Debian wsl in the pwd

I set my debian.exe's path in settings.json as the intergrated shell.
But when i use the keybinding to open it, it opens at the path ~ instead of /mnt/c/xxxxx.

The plugin works well with cmd and Powershell in my vscode.

This extension is now deprecated

From VS Code version 1.37 you can do everything this extension by adding the following setting to your settings.json file:

"terminal.integrated.cwd": "${fileDirname}"

Suggestion: Introduce optional toggle behaviour

Hello, is there any chance that the option could be introduced whereby invoking Terminal Here on on existing open terminal simply closed it, in other words making it a toggle operation. Maybe it could be configurable:

"editor.terminal-here": "toggle"/"immediate"

Not working for Linux subsystem (bash) in Windows 10

I am using Ubuntu Linux subsystem inside Windows 10 and have changed "terminal.integrated.shell.windows" to "C:\\Windows\\System32\\bash.exe" to make vscode use bash as the terminal.

When using terminal-here, the bash shell is launched, but the cd $DIR command fails because it still uses Windows style path like:
D:\Devel\Android\aosp
instead of Linux subsystem path:
/mnt/d/Devel/Android/aosp

Incorrect detection of ubuntu subsystem

When you run the command and your default terminal is the Ubuntu subsystem for Windows, the extension still applies the default behavior for Windows, giving an incorrect path:

cd "c:\Users\Whimzee\Desktop\project\"
$ cd "c:\Users\Ben\Desktop\project\"
-bash: cd: c:\Users\Whimzee\Desktop\project\: No such file or directory

This is how I have my terminal path set up in settings, which is default for the current distribution:

{
    "terminal.integrated.shell.windows": "ubuntu.exe"
}

My understanding is that something must be wrong with how the extension detects the Ubuntu subsystem.

Behave like workbench.action.terminal.focus

I use this little trick to be able to switch between terminal and editor

    {
        "key": "ctrl+`",
        "command": "workbench.action.terminal.focus"
    },
    {
        "key": "ctrl+`",
        "command": "workbench.action.focusActiveEditorGroup",
        "when": "terminalFocus"
    }

With workbench.action.terminal.focus if a terminal isn't open it opens one, if a terminal is open it just switches focus. It would be nice for terminalHere.create to behave similarly

Right now I use this workaround

    {
        "key": "ctrl+shift+`",
        "command": "terminalHere.create",
        "when": "editorFocus"
    }

Change Windows drive

If I have a file "E:\testdir\test.txt" and i want open a terminal on this drive in this folder, then your extension works not correctly, because your extension will not change the drive by enter "E:". Actually the executed command "cd E:\testdir" is not enough for windows.
Could you please extend your extension and support different windows drives.
Best regards
Joe

Default directory location per project.

I want to configure per workspace on where the terminal can start.

The extension currently opens a terminal at the current directory of the opened file.

Another feature to consider is adding a right click menu item on the project panel to start terminal in the selected directory.

Visual glitch

macOS 10.13.1 High Sierra
1.18.1 VSCode (stable)
1.19.0 VSCode (insiders)

Hi Daniel, I’ve just installed your Terminal Here extension and it works well. Just one visual glitch, it shows the cd command twice. See attached image. Better if there was just be the one cd, and even better if that was > /dev/null. Silent, in other words!

screen shot 2017-11-27 at 21 18 24

Frequent error has started appearing

macOS 10.13.2
VSCode 1.20.0 Insiders

I have just updated to the latest version of VSCode Insiders, and I have started to see the error A system error occurred (ENOENT: no such file or directory, stat '/Users/carlca/.vscode-insiders/extensions/Tyriar.vscode-terminal-here-0.0.5/out/src') appear on a fairly frequent basis. Do I need to add something to my config or is there some other cause?

Ctrl ` still seems to invoke the terminal ok, although I do recall reading recently that the operation of Terminal Here has changed slightly. Do I need to do something differently? Thanks.

Clear screen after folder initialization.

Currently you see all logs with folder switching when you start a terminal, maybe it will be better to clear screen after initialization (in addition, this currently working directory is visible in prompt).
Command clear is suitable for almost all consoles (?), and only cmd uses cls.

I am unfamiliar with JS :) And did this as follows:

    var clearCommand = "clear";                                  // <--- Here
    var dir = path.dirname(uri.fsPath);
    var terminal = vscode.window.createTerminal();
    terminal.show(false);
    switch (kindOfShell(vscode.workspace.getConfiguration('terminal'))) {
        case "wslbash":
            // c:\workspace\foo to /mnt/c/workspace/foo
            dir = dir.replace(/(\w):/, '/mnt/$1').replace(/\\/g, '/');
            break;
        case "cmd":
            // send 1st two characters (drive letter and colon) to the terminal
            // so that drive letter is updated before running cd
            clearCommand = "cls";                                // <--- Here
            terminal.sendText(dir.slice(0, 2));
    }
    terminal.sendText("cd \"" + dir + "\"");
    terminal.sendText(clearCommand);                             // <--- Here

I can open a PR if this seems reasonable for you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.