GithubHelp home page GithubHelp logo

wagnerhsu / tools-windows-terminal-context-menu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kerol2r20/windows-terminal-context-menu

0.0 1.0 0.0 286 KB

๐Ÿ“ƒ This is a simple script to add right click context menu for your best Windows terminal โค

PowerShell 100.00%

tools-windows-terminal-context-menu's Introduction

๐Ÿงพ Windows-terminal-context-menu

Inspired from Windows terminal issue Add "open Windows terminal here" into right-click context menu #1060. Thanks to you all giants โค

Windows terminal is an excellent terminal. But it does not offer a basic function which is right click context menu!
Without it, I have to cd to my working directory everytime. It's inefficient.

So I wrote this script to deal with it.

Feature

  • Two layers of context menu
  • Auto parse settings.json to contruct menu
  • With uninstaller

Todo

  • Custom icon for profile

Install

  1. Clone this repo git clone https://github.com/kerol2r20/Windows-terminal-context-menu

  2. Run powershell (no need to get admin access right)

  3. Change the execution policy Set-ExecutionPolicy Unrestricted -scope CurrentUser

  4. Run SetupContextMenu.ps1 script

โš ๏ธ If you find no item in your context menu, it may be caused by the old style profiles.json. You can delete %LocalAppData%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\profiles.json and restart Windows terminal. The new one will be generated. Ref to microsoft/terminal#4556

Uninstall

  1. Run SetupContextMenu.ps1 -uninstall:$true

Config

This script will parse the settings.json file to generate menu items. However you can customize it.
Put any icon file into icon folder and modify the config.json like the following.

{
    "global": {
        "extended": false
    },
    "profiles": {
        "{a5a97cb8-8961-5535-816d-772efe0c6a3f}": {
            "icon": "arch.ico",
            "label": "Arch Linux"
        },
        "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}": {
            "showRunAs": true
        },
        "{b453ae62-4e3d-5e58-b989-0a998ec441b8}": {
            "hidden": true
        }
    }
}

Config reference

  • global
    • extended[bool]: if set this to true, context menu will only show up when right click with shift
  • profiles
    • guid[string]: this GUID of your profile defined in settings.json
      • hidden[bool]: overwrites the visibility of the profile, if defined
      • icon[string]: filename of your ico file, you must put this file in icon folder
      • label[string]: context menu label
      • showRunAs[bool]: add run as administrator item for this profile

Misc

I'm not sure that icons file are legal or not. If you feel it is not ok, please tell me. Thanks.

tools-windows-terminal-context-menu's People

Contributors

kerol2r20 avatar kiritodv avatar jan-di avatar nmutsu avatar akr2002 avatar felipecrs avatar clinmanc avatar koushikphy avatar

Watchers

James Cloos avatar

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.