├── .gitignore ├── .no-sublime-package ├── Context.sublime-menu ├── Default (Linux).sublime-keymap ├── Default (OSX).sublime-keymap ├── Default (Windows).sublime-keymap ├── Default.sublime-commands ├── LICENSE ├── Main.sublime-menu ├── PS.bat ├── PS.ps1 ├── Side Bar.sublime-menu ├── Terminal.py ├── Terminal.sh ├── Terminal.sublime-settings ├── changelog.md ├── hyper.sh ├── iTerm.sh ├── iTerm2-v3.sh ├── messages.json ├── messages ├── 1.13.0.txt ├── 1.4.0.txt ├── 1.7.0.txt └── 1.8.0.txt ├── readme.md └── release.sh /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *.sublime-project 3 | *.sublime-workspace 4 | -------------------------------------------------------------------------------- /.no-sublime-package: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wbond/sublime_terminal/1154dfc764b0fe3a548180e8dbc09bf9e3c9a31e/.no-sublime-package -------------------------------------------------------------------------------- /Context.sublime-menu: -------------------------------------------------------------------------------- 1 | [ 2 | { "caption": "-", "id": "file" }, 3 | { "command": "open_terminal", "caption": "Open Terminal Here…" } 4 | ] -------------------------------------------------------------------------------- /Default (Linux).sublime-keymap: -------------------------------------------------------------------------------- 1 | [ 2 | { "keys": ["ctrl+shift+t"], "command": "open_terminal" }, 3 | { "keys": ["ctrl+shift+alt+t"], "command": "open_terminal_project_folder" } 4 | ] -------------------------------------------------------------------------------- /Default (OSX).sublime-keymap: -------------------------------------------------------------------------------- 1 | [ 2 | { "keys": ["super+shift+t"], "command": "open_terminal" }, 3 | { "keys": ["super+shift+alt+t"], "command": "open_terminal_project_folder" } 4 | ] -------------------------------------------------------------------------------- /Default (Windows).sublime-keymap: -------------------------------------------------------------------------------- 1 | [ 2 | { "keys": ["ctrl+shift+t"], "command": "open_terminal" }, 3 | { "keys": ["ctrl+shift+alt+t"], "command": "open_terminal_project_folder" } 4 | ] -------------------------------------------------------------------------------- /Default.sublime-commands: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "caption": "Preferences: Terminal Settings – Default", 4 | "command": "open_file", 5 | "args": { 6 | "file": "${packages}/Terminal/Terminal.sublime-settings" 7 | } 8 | }, 9 | { 10 | "caption": "Preferences: Terminal Settings – User", 11 | "command": "open_file", 12 | "args": { 13 | "file": "${packages}/User/Terminal.sublime-settings" 14 | } 15 | }, 16 | { 17 | "caption": "Preferences: Terminal Key Bindings – Default", 18 | "command": "open_file", 19 | "args": { 20 | "file": "${packages}/Terminal/Default (Windows).sublime-keymap", 21 | "platform": "Windows" 22 | } 23 | }, 24 | { 25 | "caption": "Preferences: Terminal Key Bindings – Default", 26 | "command": "open_file", 27 | "args": { 28 | "file": "${packages}/Terminal/Default (OSX).sublime-keymap", 29 | "platform": "OSX" 30 | } 31 | }, 32 | { 33 | "caption": "Preferences: Terminal Key Bindings – Default", 34 | "command": "open_file", 35 | "args": { 36 | "file": "${packages}/Terminal/Default (Linux).sublime-keymap", 37 | "platform": "Linux" 38 | } 39 | }, 40 | { 41 | "caption": "Preferences: Terminal Key Bindings – User", 42 | "command": "open_file", 43 | "args": { 44 | "file": "${packages}/User/Default (Windows).sublime-keymap", 45 | "platform": "Windows" 46 | } 47 | }, 48 | { 49 | "caption": "Preferences: Terminal Key Bindings – User", 50 | "command": "open_file", 51 | "args": { 52 | "file": "${packages}/User/Default (OSX).sublime-keymap", 53 | "platform": "OSX" 54 | } 55 | }, 56 | { 57 | "caption": "Preferences: Terminal Key Bindings – User", 58 | "command": "open_file", 59 | "args": { 60 | "file": "${packages}/User/Default (Linux).sublime-keymap", 61 | "platform": "Linux" 62 | } 63 | }, 64 | { 65 | "caption": "Terminal: Open", 66 | "command": "open_terminal" 67 | }, 68 | { 69 | "caption": "Terminal: Open in project folder", 70 | "command": "open_terminal_project_folder" 71 | } 72 | ] 73 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011 Will Bond 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Main.sublime-menu: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "caption": "Preferences", 4 | "mnemonic": "n", 5 | "id": "preferences", 6 | "children": 7 | [ 8 | { 9 | "caption": "Package Settings", 10 | "mnemonic": "P", 11 | "id": "package-settings", 12 | "children": 13 | [ 14 | { 15 | "caption": "Terminal", 16 | "children": 17 | [ 18 | { 19 | "command": "open_file", 20 | "args": {"file": "${packages}/Terminal/Terminal.sublime-settings"}, 21 | "caption": "Settings – Default" 22 | }, 23 | { 24 | "command": "open_file", 25 | "args": {"file": "${packages}/User/Terminal.sublime-settings"}, 26 | "caption": "Settings – User" 27 | }, 28 | { 29 | "caption": "Settings – More", 30 | "children": 31 | [ 32 | { 33 | "command": "open_file", 34 | "args": { 35 | "file": "${packages}/User/Terminal (Windows).sublime-settings", 36 | "platform": "Windows" 37 | }, 38 | "caption": "OS Specific – User" 39 | }, 40 | { 41 | "command": "open_file", 42 | "args": { 43 | "file": "${packages}/User/Terminal (OSX).sublime-settings", 44 | "platform": "OSX" 45 | }, 46 | "caption": "OS Specific – User" 47 | }, 48 | { 49 | "command": "open_file", 50 | "args": { 51 | "file": "${packages}/User/Terminal (Linux).sublime-settings", 52 | "platform": "Linux" 53 | }, 54 | "caption": "OS Specific – User" 55 | } 56 | ] 57 | }, 58 | { 59 | "caption": "-" 60 | }, 61 | { 62 | "command": "open_file", 63 | "args": { 64 | "file": "${packages}/Terminal/Default (Windows).sublime-keymap", 65 | "platform": "Windows" 66 | }, 67 | "caption": "Key Bindings – Default" 68 | }, 69 | { 70 | "command": "open_file", 71 | "args": { 72 | "file": "${packages}/Terminal/Default (OSX).sublime-keymap", 73 | "platform": "OSX" 74 | }, 75 | "caption": "Key Bindings – Default" 76 | }, 77 | { 78 | "command": "open_file", 79 | "args": { 80 | "file": "${packages}/Terminal/Default (Linux).sublime-keymap", 81 | "platform": "Linux" 82 | }, 83 | "caption": "Key Bindings – Default" 84 | }, 85 | { 86 | "command": "open_file", 87 | "args": { 88 | "file": "${packages}/User/Default (Windows).sublime-keymap", 89 | "platform": "Windows" 90 | }, 91 | "caption": "Key Bindings – User" 92 | }, 93 | { 94 | "command": "open_file", 95 | "args": { 96 | "file": "${packages}/User/Default (OSX).sublime-keymap", 97 | "platform": "OSX" 98 | }, 99 | "caption": "Key Bindings – User" 100 | }, 101 | { 102 | "command": "open_file", 103 | "args": { 104 | "file": "${packages}/User/Default (Linux).sublime-keymap", 105 | "platform": "Linux" 106 | }, 107 | "caption": "Key Bindings – User" 108 | }, 109 | { "caption": "-" } 110 | ] 111 | } 112 | ] 113 | } 114 | ] 115 | } 116 | ] 117 | -------------------------------------------------------------------------------- /PS.bat: -------------------------------------------------------------------------------- 1 | start powershell -noexit -ExecutionPolicy RemoteSigned "%sublime_terminal_path%\PS.ps1" -------------------------------------------------------------------------------- /PS.ps1: -------------------------------------------------------------------------------- 1 | $pshost = get-host 2 | $pswindow = $pshost.ui.rawui 3 | 4 | $newsize = $pswindow.buffersize 5 | $newsize.height = 3000 6 | $newsize.width = 120 7 | $pswindow.buffersize = $newsize 8 | 9 | $newsize = $pswindow.windowsize 10 | $newsize.height = 50 11 | $newsize.width = 120 12 | $pswindow.windowsize = $newsize 13 | 14 | $pswindow.windowtitle = "Windows Powershell" 15 | $pswindow.foregroundcolor = "DarkYellow" 16 | $pswindow.backgroundcolor = "DarkMagenta" 17 | 18 | cls -------------------------------------------------------------------------------- /Side Bar.sublime-menu: -------------------------------------------------------------------------------- 1 | [ 2 | { "caption": "Open Terminal Here…", "command": "open_terminal", "args": {"paths": []} } 3 | ] 4 | -------------------------------------------------------------------------------- /Terminal.py: -------------------------------------------------------------------------------- 1 | import sublime 2 | import sublime_plugin 3 | import os 4 | import sys 5 | import subprocess 6 | import locale 7 | 8 | if os.name == 'nt': 9 | try: 10 | import _winreg 11 | except (ImportError): 12 | import winreg as _winreg 13 | from ctypes import windll, create_unicode_buffer 14 | 15 | class NotFoundError(Exception): 16 | pass 17 | 18 | 19 | if sys.version_info >= (3,): 20 | installed_dir, _ = __name__.split('.') 21 | else: 22 | installed_dir = os.path.basename(os.getcwd()) 23 | 24 | def get_setting(key, default=None): 25 | settings = sublime.load_settings('Terminal.sublime-settings') 26 | os_specific_settings = {} 27 | if os.name == 'nt': 28 | os_specific_settings = sublime.load_settings('Terminal (Windows).sublime-settings') 29 | elif sys.platform == 'darwin': 30 | os_specific_settings = sublime.load_settings('Terminal (OSX).sublime-settings') 31 | else: 32 | os_specific_settings = sublime.load_settings('Terminal (Linux).sublime-settings') 33 | return os_specific_settings.get(key, settings.get(key, default)) 34 | 35 | 36 | class TerminalSelector(): 37 | default = None 38 | 39 | @staticmethod 40 | def get(terminal_key): 41 | package_dir = os.path.join(sublime.packages_path(), installed_dir) 42 | terminal = get_setting(terminal_key) 43 | if terminal: 44 | dir, executable = os.path.split(terminal) 45 | if not dir: 46 | joined_terminal = os.path.join(package_dir, executable) 47 | if os.path.exists(joined_terminal): 48 | terminal = joined_terminal 49 | if not os.access(terminal, os.X_OK): 50 | os.chmod(terminal, 0o755) 51 | return terminal 52 | 53 | if TerminalSelector.default: 54 | return TerminalSelector.default 55 | 56 | default = None 57 | 58 | if os.name == 'nt': 59 | if os.path.exists(os.environ['SYSTEMROOT'] + 60 | '\\System32\\WindowsPowerShell\\v1.0\\powershell.exe'): 61 | # This mimics the default powershell colors since calling 62 | # subprocess.POpen() ends up acting like launching powershell 63 | # from cmd.exe. Normally the size and color are inherited 64 | # from cmd.exe, but this creates a custom mapping, and then 65 | # the LaunchPowerShell.bat file adjusts some other settings. 66 | key_string = 'Console\\%SystemRoot%_system32_' + \ 67 | 'WindowsPowerShell_v1.0_powershell.exe' 68 | try: 69 | key = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, 70 | key_string) 71 | except (WindowsError): 72 | key = _winreg.CreateKey(_winreg.HKEY_CURRENT_USER, 73 | key_string) 74 | _winreg.SetValueEx(key, 'ColorTable05', 0, 75 | _winreg.REG_DWORD, 5645313) 76 | _winreg.SetValueEx(key, 'ColorTable06', 0, 77 | _winreg.REG_DWORD, 15789550) 78 | default = os.path.join(package_dir, 'PS.bat') 79 | sublime_terminal_path = os.path.join(sublime.packages_path(), installed_dir) 80 | # This should turn the path into an 8.3-style path, getting around unicode 81 | # issues and spaces 82 | buf = create_unicode_buffer(512) 83 | if windll.kernel32.GetShortPathNameW(sublime_terminal_path, buf, len(buf)): 84 | sublime_terminal_path = buf.value 85 | os.environ['sublime_terminal_path'] = sublime_terminal_path.replace(' ', '` ') 86 | else : 87 | default = os.environ['SYSTEMROOT'] + '\\System32\\cmd.exe' 88 | 89 | elif sys.platform == 'darwin': 90 | default = os.path.join(package_dir, 'Terminal.sh') 91 | if not os.access(default, os.X_OK): 92 | os.chmod(default, 0o755) 93 | 94 | else: 95 | ps = 'ps -eo comm,args | grep -E "^(gnome-session|ksmserver|' + \ 96 | 'xfce4-session|lxsession|mate-panel|cinnamon-sessio)" | grep -v grep' 97 | wm = [x.replace("\n", '') for x in os.popen(ps)] 98 | if wm: 99 | # elementary OS: `/usr/lib/gnome-session/gnome-session-binary --session=pantheon` 100 | # Gnome: `gnome-session` or `gnome-session-binary` 101 | # Linux Mint Cinnamon: `cinnamon-session --session cinnamon` 102 | if wm[0].startswith('gnome-session') or wm[0].startswith('cinnamon-sessio'): 103 | if 'pantheon' in wm[0]: 104 | default = 'pantheon-terminal' 105 | else: 106 | default = 'gnome-terminal' 107 | elif wm[0].startswith('xfce4-session'): 108 | default = 'xfce4-terminal' 109 | elif wm[0].startswith('ksmserver'): 110 | default = 'konsole' 111 | elif wm[0].startswith('lxsession'): 112 | default = 'lxterminal' 113 | elif wm[0].startswith('mate-panel'): 114 | default = 'mate-terminal' 115 | if not default: 116 | default = 'xterm' 117 | 118 | TerminalSelector.default = default 119 | return default 120 | 121 | 122 | class TerminalCommand(): 123 | def get_path(self, paths): 124 | if paths: 125 | return paths[0] 126 | # DEV: On ST3, there is always an active view. 127 | # Be sure to check that it's a file with a path (not temporary view) 128 | elif self.window.active_view() and self.window.active_view().file_name(): 129 | return self.window.active_view().file_name() 130 | elif self.window.folders(): 131 | return self.window.folders()[0] 132 | else: 133 | sublime.error_message('Terminal: No place to open terminal to') 134 | return False 135 | 136 | def run_terminal(self, dir_, terminal, parameters): 137 | try: 138 | if not dir_: 139 | raise NotFoundError('The file open in the selected view has ' + 140 | 'not yet been saved') 141 | for k, v in enumerate(parameters): 142 | parameters[k] = v.replace('%CWD%', dir_) 143 | args = [TerminalSelector.get(terminal)] 144 | args.extend(parameters) 145 | 146 | encoding = locale.getpreferredencoding(do_setlocale=True) 147 | if sys.version_info >= (3,): 148 | cwd = dir_ 149 | else: 150 | cwd = dir_.encode(encoding) 151 | 152 | # Copy over environment settings onto parent environment 153 | env_setting = get_setting('env', {}) 154 | env = os.environ.copy() 155 | for k in env_setting: 156 | if env_setting[k] is None: 157 | env.pop(k, None) 158 | else: 159 | env[k] = env_setting[k] 160 | 161 | # Normalize environment settings for ST2 162 | # https://github.com/wbond/sublime_terminal/issues/154 163 | # http://stackoverflow.com/a/4987414 164 | for k in env: 165 | if not isinstance(env[k], str): 166 | if isinstance(env[k], unicode): 167 | env[k] = env[k].encode('utf8') 168 | else: 169 | print('Unsupported environment variable type. Expected "str" or "unicode"', env[k]) 170 | 171 | # Run our process 172 | subprocess.Popen(args, cwd=cwd, env=env) 173 | 174 | except (OSError) as exception: 175 | print(str(exception)) 176 | sublime.error_message('Terminal: The terminal ' + 177 | TerminalSelector.get() + ' was not found') 178 | except (Exception) as exception: 179 | sublime.error_message('Terminal: ' + str(exception)) 180 | 181 | 182 | class OpenTerminalCommand(sublime_plugin.WindowCommand, TerminalCommand): 183 | def run(self, paths=[], parameters=None, terminal=None): 184 | path = self.get_path(paths) 185 | if not path: 186 | return 187 | 188 | if terminal is None: 189 | terminal = 'terminal' 190 | 191 | if parameters is None: 192 | parameters = get_setting('parameters', []) 193 | 194 | if os.path.isfile(path): 195 | path = os.path.dirname(path) 196 | 197 | self.run_terminal(path, terminal, parameters) 198 | 199 | 200 | class OpenTerminalProjectFolderCommand(sublime_plugin.WindowCommand, 201 | TerminalCommand): 202 | def run(self, paths=[], parameters=None): 203 | path = self.get_path(paths) 204 | if not path: 205 | return 206 | 207 | # DEV: We require separator to be appended since `/hello` and `/hello-world` 208 | # would both match a file in `/hello` without it 209 | # For more info, see https://github.com/wbond/sublime_terminal/issues/86 210 | folders = [x for x in self.window.folders() if path.find(x + os.sep) == 0][0:1] 211 | 212 | command = OpenTerminalCommand(self.window) 213 | command.run(folders, parameters=parameters) 214 | -------------------------------------------------------------------------------- /Terminal.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | CD_CMD="cd "\\\"$(pwd)\\\"" && clear" 4 | if echo "$SHELL" | grep -E "/fish$" &> /dev/null; then 5 | CD_CMD="cd "\\\"$(pwd)\\\""; and clear" 6 | fi 7 | VERSION=$(sw_vers -productVersion) 8 | if (( $(expr $VERSION '<' 10.7.0) )); then 9 | IN_WINDOW="in window 1" 10 | fi 11 | osascript</dev/null < /dev/null; then 5 | CD_CMD="cd "\\\"$(pwd)\\\""; and clear" 6 | fi 7 | VERSION=$(sw_vers -productVersion) 8 | OPEN_IN_TAB=0 9 | 10 | while [ "$1" != "" ]; do 11 | PARAM="$1" 12 | VALUE="$2" 13 | case "$PARAM" in 14 | --open-in-tab) 15 | OPEN_IN_TAB=1 16 | ;; 17 | esac 18 | shift 19 | done 20 | 21 | if (( $(expr $VERSION '<' 10.7) )); then 22 | RUNNING=$(osascript</dev/null </dev/null < /dev/null; then 5 | CD_CMD="cd "\\\"$(pwd)\\\""; and clear" 6 | fi 7 | VERSION=$(sw_vers -productVersion) 8 | OPEN_IN_TAB=0 9 | 10 | while [ "$1" != "" ]; do 11 | PARAM="$1" 12 | VALUE="$2" 13 | case "$PARAM" in 14 | --open-in-tab) 15 | OPEN_IN_TAB=1 16 | ;; 17 | esac 18 | shift 19 | done 20 | 21 | if (( $(expr $VERSION '<' 10.7) )); then 22 | RUNNING=$(osascript</dev/null </dev/null < Package Settings -> Terminal -> Settings - More -> OS Specific - User" 5 | -------------------------------------------------------------------------------- /messages/1.8.0.txt: -------------------------------------------------------------------------------- 1 | Sublime Terminal 1.8.0 Changelog: 2 | - Added support for opening a new tab in iTerm via @vitorhsb in #72 3 | - https://github.com/wbond/sublime_terminal/pull/72 4 | - If you are using the `iTerm.sh` as your terminal, this can be configured via: 5 | { 6 | "terminal": "iTerm.sh", 7 | "parameters": ["--open-in-tab"] 8 | } 9 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Sublime Terminal 2 | 3 | Shortcuts and menu entries for opening a terminal at the current file, or the current root project folder in [Sublime Text](http://sublimetext.com/). 4 | 5 | ## Features 6 | 7 | - Opens a terminal in the folder containing the currently edited file 8 | - Opens a terminal in the project folder containing the currently edited file 9 | 10 | ## Installation 11 | 12 | Download [Package Control](https://packagecontrol.io/) and use the *Package Control: Install Package* command from the command palette. Using Package Control ensures Terminal will stay up to date automatically. 13 | 14 | ## Usage 15 | 16 | - **Open Terminal at File** 17 | Press *ctrl+shift+t* on Windows and Linux, or *cmd+shift+t* on OS X 18 | - **Open Terminal at Project Folder** 19 | Press *ctrl+alt+shift+t* on Windows and Linux, or *cmd+alt+shift+t* on OS X 20 | 21 | In addition to the key bindings, terminals can also be opened via the editor context menu and the sidebar context menus. 22 | 23 | ## Package Settings 24 | 25 | The default settings can be viewed by accessing the ***Preferences > Package Settings > Terminal > Settings – Default*** menu entry. To ensure settings are not lost when the package is upgraded, make sure all edits are saved to ***Settings – User***. 26 | 27 | - **terminal** 28 | - The terminal to execute, will default to the OS default if blank. OS X users may enter *iTerm.sh* to launch iTerm if installed. 29 | - *Default:* ***""*** 30 | - **parameters** 31 | - The parameters to pass to the terminal. These parameters will be used if no [custom parameters](#custom-parameters) are passed via a key binding. 32 | - *Default:* ***[]*** 33 | - **env** 34 | - The environment variables changeset. Default environment variables used when invoking the terminal are inherited from sublime. 35 | - The changeset may be used to overwrite/unset environment variables. Use `null` to indicate that the environment variable should be unset. 36 | - *Default:* ***{}*** 37 | 38 | ### Examples 39 | 40 | Here are some example setups: 41 | 42 | #### Cmder on Windows 43 | 44 | ```js 45 | { 46 | // Replace with your own path to cmder.exe 47 | "terminal": "C:\\Program Files\\cmder_mini\\cmder.exe", 48 | "parameters": ["/START", "%CWD%"] 49 | } 50 | ``` 51 | 52 | #### xterm on GNU/Linux 53 | 54 | ```js 55 | { 56 | "terminal": "xterm" 57 | } 58 | ``` 59 | 60 | #### gnome-terminal for CJK users on GNU/Linux 61 | 62 | ```js 63 | { 64 | "terminal": "gnome-terminal", 65 | // Unset LD_PRELOAD which may cause problems for sublime with imfix 66 | "env": {"LD_PRELOAD": null} 67 | } 68 | ``` 69 | #### iTerm on OS X 70 | 71 | ```js 72 | { 73 | "terminal": "iTerm.sh" 74 | } 75 | ``` 76 | 77 | #### iTerm on OS X with tabs 78 | 79 | ```js 80 | { 81 | "terminal": "iTerm.sh", 82 | "parameters": ["--open-in-tab"] 83 | } 84 | ``` 85 | 86 | #### iTerm2 v3 on OS X 87 | 88 | ```js 89 | { 90 | "terminal": "iTerm2-v3.sh" 91 | } 92 | ``` 93 | 94 | #### Hyper on OS X 95 | 96 | ```js 97 | { 98 | "terminal": "hyper.sh" 99 | } 100 | ``` 101 | 102 | #### [Windows Terminal](https://github.com/microsoft/terminal) 103 | 104 | ```js 105 | { 106 | "terminal": "C:/Users/yourusername/AppData/Local/Microsoft/WindowsApps/wt.exe", 107 | "parameters": ["-d", "."] 108 | } 109 | ``` 110 | 111 | 112 | ## Custom Parameters 113 | 114 | With the parameters argument to the *open_terminal* and *open_terminal_project_folder* commands, it is possible to construct custom terminal environments. 115 | 116 | The following is an example of passing the parameters *-T 'Custom Window Title'* to a terminal. Please note that this example is just an example, and is tailored to the XFCE terminal application. Your terminal may use the `-T` option for some other features or setting. Custom key bindings such as this would be added to the file opened when accessing the *Preferences > Key Bindings – User* menu entry (the file name varies by operating system). 117 | 118 | ```json 119 | { 120 | "keys": ["ctrl+alt+t"], 121 | "command": "open_terminal", 122 | "args": { 123 | "parameters": ["-T", "Custom Window Title"] 124 | } 125 | } 126 | ``` 127 | 128 | A parameter may also contain the *%CWD%* placeholder, which will be substituted with the current working directory the terminal was opened to. 129 | 130 | ```json 131 | { 132 | "keys": ["ctrl+alt+t"], 133 | "command": "open_terminal", 134 | "args": { 135 | "parameters": ["-T", "Working in directory %CWD%"] 136 | } 137 | } 138 | ``` 139 | -------------------------------------------------------------------------------- /release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Exit on first error 3 | set -e 4 | 5 | # Parse our CLI arguments 6 | version="$1" 7 | if test "$version" = ""; then 8 | echo "Expected a version to be provided to \`release.sh\` but none was provided." 1>&2 9 | echo "Usage: $0 [version] # (e.g. $0 1.0.0)" 1>&2 10 | exit 1 11 | fi 12 | 13 | # Verify release notes exist 14 | if ! grep "## $version\$" changelog.md &> /dev/null; then 15 | echo "Expected \`changelog.md\` to contain \`## $version\` but it didn't. Please add release notes to \`changelog.md\`" 1>&2 16 | exit 1 17 | fi 18 | 19 | # Commit any pending changes 20 | git commit -a -m "Release $version" 21 | 22 | # Tag the release 23 | git tag "$version" 24 | 25 | # Publish the release to GitHub 26 | git push 27 | git push --tags 28 | --------------------------------------------------------------------------------