docker / kitematic

Visual Docker Container Management on Mac & Windows
https://kitematic.com
Apache License 2.0
12.25k stars 1.41k forks source link

Ability to select terminal, and browser in settings #47

Open neogenix opened 10 years ago

neogenix commented 10 years ago

At the moment it seems to default, it'd be nice to be able to select the app to use when clicking on terminal or view app.

jmorganca commented 10 years ago

Thanks for creating a ticket!

For terminal we default iTerm.app if it's installed, otherwise Terminal.app.

For browsers we use the default browser on your computer. This can be changed in settings > General for 10.10+ and in Safari > Preferences for 10.9-

With this implementation, do you think it's still worth having a way to select the app for each?

neogenix commented 10 years ago

@jeffdm The reason it came to mind was mostly because if I wanted to look at something in a different browser I could set it... perhaps a drop down, or something along those lines? It's likely a low priority thing.

mickaelandrieu commented 9 years ago

@jeffdm for Windows it's very annoying because this is powershell which is used and we have a lot of better terminals.

Any hack (for now) in order to use another terminal ?

dlamblin commented 9 years ago

@jeffdm Yes it is still worth having a way to select. I'm on a mac with 10.10, the latest terminal seems to have reached par with iTerm and has a couple of things iTerm won't do, like alt-arrow moves between words on the bash prompt (I'm sure it's configurable somewhere) or right click anywhere to spawn a man-page window of the word you're clicking on. Even if it's a pref that must be set with defaults, or just a checkbox that says "prefer Apple terminal"

uberhacker commented 8 years ago

Echoing @mickaelandrieu: Windows powershell is terrible. Essential control keys like backspace and arrows don't even work. Please make this configurable. Kitematic is a great tool and you guys have done a great job so far.

alankent commented 8 years ago

It would be good to be able to use a shell of choice (cygwin comes to mind), or get TERM set correctly or powershell (if such a thing exists) so when you docker exec into a container you can use vi or less. Powershell does not support the xterm escape sequences completely, making vi pretty hard to use.

mindw commented 8 years ago

Git for windows provides an excellent mintty terminal. An alternative is the msys2. Both can be detected at runtime and are not "terrible" :)

alankent commented 8 years ago

What is even more interesting is "Docker Quickstart Terminal" works well on Windows. But Kitematic does not use the same terminal type, using Powershell instead. Even if not configurable, using the same terminal window as Quickstart would be a big improvement.

lilyball commented 8 years ago

On OS X, Kitematic definitely needs a setting to let me choose the terminal. Just because I have iTerm installed doesn't mean that's what I want to use. I only have iTerm installed for the very rare time when I need to compare the behavior of some tool across multiple terminal emulators, I use Terminal.app for everything else.

FrenchBen commented 8 years ago

@kballard Feel free to implement such feature and send us a PR :)

deftdawg commented 6 years ago

Being forced to use Windows 7 at work makes me turn green, but needing to use Powershell or CMD as a terminal really makes me want to hulk smash my work machine.

Here are some rough notes as to how I hacked Kitematic to use CMDer instead:

Unpack the app asar archive

cd '/c/Program Files/Docker Toolbox/kitematic/resources' mv app.asar start-cmder.cmd npm install asar # need this asar extract start-cmder.cmd tmp cd tmp/utils

Apply this patch

diff -u DockerMachineUtil.js.orig DockerMachineUtil.js
--- DockerMachineUtil.js.orig   2018-08-22 09:15:31.411700000 -0400
+++ DockerMachineUtil.js        2018-08-22 09:12:25.042200000 -0400
@@ -213,10 +213,10 @@
     cmd = cmd || process.env.SHELL || '';
     if (_Util2['default'].isWindows()) {
       if (_Util2['default'].isNative()) {
-        _Util2['default'].exec('start powershell.exe ' + cmd);
+        _Util2['default'].exec('start-cmder.cmd "' + cmd + '" "Docker"');
       } else {
         this.url(machineName).then(function (machineUrl) {
-          _Util2['default'].exec('start powershell.exe ' + cmd, { env: {
+          _Util2['default'].exec('start-cmder.cmd "' + cmd + '" "Docker"', { env: {
               'DOCKER_HOST': machineUrl,
               'DOCKER_CERT_PATH': process.env.DOCKER_CERT_PATH || _path2['default'].join(_Util2['default'].home(), '.docker', 'machine', 'machines', machineName),
               'DOCKER_TLS_VERIFY': 1

Pack it back up

cd .. asar pack . ../app.asar asar list ../app.asar # make sure it looks okay

Use a batch file to set up the terminal session

cd c:\Windows nano start-cmder.cmd # create this file and change CMDER_ROOT to wherever you have CMDer installed

@REM @echo off
@REM Cmder Window Starter
@REM Based on https://github.com/cmderdev/cmder/issues/457#issuecomment-94271232
@REM
@REM Takes two arguments, will reuse window on subsiquent launches
@REM "cmd" "Window title"
@REM start-cmder.cmd "cmd.exe /k docker exec -it 97638585ebbabd4b708df62eec849d544827133ea7ba38a380e5380f4ed7dfb0 /bin/bash" "Docker"
@REM
@REM TODO: figure out how to apply -new_console option to rename tab to container name
@REM
set CMDER_ROOT=%USERPROFILE%\Downloads\cmder
set CMDER_TITLE=Docker
start %CMDER_ROOT%\vendor\conemu-maximus5\ConEmu.exe /icon "%CMDER_ROOT%\cmder.exe" /title "%CMDER_TITLE%" /loadcfgfile "%CMDER_ROOT%\config\ConEmu.xml" /reuse /run cmd /C "%CMDER_ROOT%\vendor\init.bat cd %CD% && %~1"