hyper icon indicating copy to clipboard operation
hyper copied to clipboard

Support for multiple shells

Open atrauzzi opened this issue 7 years ago • 43 comments

What would be better than the shell option?

Multiple shells! I'd love to be able to have both Linux on Windows as well as PowerShell tabs open :)

atrauzzi avatar Dec 12 '16 23:12 atrauzzi

I'd be interested in this also. It is one of my favorite features of ConEmu as I find myself in cmd and PowerShell quite often throughout the day.

ekinnee avatar Dec 20 '16 21:12 ekinnee

I would also be very much interested in this on Windows - similar to ConEmu would be ideal.

(apologies if this is not how the Community Feedback label works)

lllama avatar Jan 09 '17 15:01 lllama

Hmm, how would this work?

For now I'd suggest just opening a new tab and typing, for example, powershell (given that you're default one is bash) 😄

matheuss avatar Jan 21 '17 18:01 matheuss

In ConEmu, I have ctrl- mapped to different shells. I have powershell, powershell as admin, and cmd as my main three, but also have the various Visual Studio cmd shells mapped as well. Being able to replicate this would be great.

lllama avatar Jan 21 '17 20:01 lllama

I'd also like this feature, especially to easily start admin shells.

lediur avatar Mar 07 '17 03:03 lediur

Yes, agreed, an easy way to open an admin shell would be great on Windows.

ehdevries avatar Mar 23 '17 13:03 ehdevries

related pull request: https://github.com/zeit/hyper/pull/1347

MartyGentillon avatar Apr 15 '17 08:04 MartyGentillon

This is definitely a feature I'd like to see too.

szul avatar Apr 22 '17 21:04 szul

Agreed.

fallspectrum avatar Apr 26 '17 17:04 fallspectrum

This feature would be extremely useful, especially on Windows where there are several shell types I constantly switch between (bash, powershell, regular command line, vs command line)

doppleware avatar May 14 '17 06:05 doppleware

Please add this! I share many of the same use cases as the people above me and it's pretty much the only thing preventing me to switch from ConEmu.

resir014 avatar Jun 26 '17 04:06 resir014

This is hugely important on Windows, and a feature provided by most other Windows terminals. While WSL does a lot, there are still some programs that only work in PowerShell. (notably Docker)

It usually works by having the "New Tab" option expand into a menu allowing the user to select a shell to use from a selection of defined presets. In addition, it's possible to add a custom keyboard mapping for each shell preset, which will open a new tab with that shell.

tobico avatar Aug 11 '17 03:08 tobico

I'm hitting session restoration before doing multiple shell. ;)

ppot avatar Aug 13 '17 00:08 ppot

While we're documenting use cases, I just came across another one today...

I'm defaulting to WSL with hyper right now, but I need PowerShell to do electron application development on Windows.

atrauzzi avatar Feb 04 '18 01:02 atrauzzi

Yes, agreed, an easy way to open an admin shell would be great on Windows.

👍 8

Could this work while keeping the powershell.exe elevated but leaving Hyper.exe as a normal user process?
If I look at ConEmu, I see that a "PowerShell Admin" tab is also starting a ConEmuC64.exe child-process with the same high integrity level as powershell.exe.

I don't think that anyone would like to run the entire Electron-stack with admin rights. 😱

Somewhat tangential, but a similar topic about running GUI applications as root and their security implications: https://blog.martin-graesslin.com/blog/2017/02/editing-files-as-root/

hsiktas avatar Feb 17 '18 18:02 hsiktas

I would like this as well. My use case is that I have to switch between wsl/bash, Visual Studio Command Prompt, PowerShell and Admin command prompt regularly.

All I want is a single terminal that I can use to drop into any of these without making my life harder.

JustSid avatar Mar 16 '18 06:03 JustSid

So, I found a work around that seems to be okay. It's not automatic, but once you have it up it works just fine. You can start out with the Powershell terminal and open a new tab and then type in bash or bash.exe and it will start the WSL (Windows Subsystem for Linux). This way you can have both terminals running. Hope this helps a few people. It took me a second of thinking and then I realized this and have been using it this way since.

@atrauzzi, maybe this solves your particular problem?

blackwire avatar Mar 23 '18 12:03 blackwire

Not really because I start with bash :)

atrauzzi avatar Mar 23 '18 22:03 atrauzzi

If you just need to run a few things using powershell in the WSL environment you can alias powershell.exe to ps or something like that in your .bashrc file and use ps yourpowershellscript.ps1 this also works with any powershell command. You can also just kick over to the powershell terminal by using powershell.exe without any parameters. This doesn't work quite as well though as if you don't have a terminal emulator for WSL it will throw up on your ssh connections.

blackwire avatar Mar 24 '18 00:03 blackwire

I think ideally we should just keep this issue focused on multi-interpreter support.

Workarounds run the risk of derailing this ticket.

atrauzzi avatar Mar 24 '18 00:03 atrauzzi

Any news?

szmarczak avatar Apr 14 '18 15:04 szmarczak

There is an awesome workaround here: https://gist.github.com/legowerewolf/a3e0eb7830752488fec329c7bdcb2d2a

I hope that it will be a plugin soon 🤞

chabou avatar Apr 14 '18 15:04 chabou

This single feature makes me still use ConEmu instead of hyper.

marcinfigiel avatar Apr 25 '18 10:04 marcinfigiel

Chiming in on this one too, would be hugely invaluable for those that need to jump around on different shells (us Windows users!). Also is one of the better features of ConEmu.

ctolkien avatar Jun 28 '18 22:06 ctolkien

One way to achieve this is what most terminal emulators do on linux - your configuration file determines the default shell, but you can specify one on the command line, like hyper -e /bin/mksh (or hyper -e C:\Windows\System32\cmd.exe)

CosmicToast avatar Jul 12 '18 01:07 CosmicToast

Here's a little workaround, extending @5paceToast 's suggestion.

This works on Windows, but using your DE on Linux, you should be able to emulate the same effect.

Create a bunch of shortcuts to Hyper, right click to properties for each, edit the command line for each to point to your intended shells. Then, with the Shortcut Key field below, assign each to a shortcut. When you reach for that hotkey, Hyper will launch with that assigned shell.

Lengthy, should be included as a feature, kinda messy: yes Works: also yes.

ThisIsSet-L avatar Aug 29 '18 16:08 ThisIsSet-L

After using windows with WSL for some weeks now, I really feel why this is necessary!

albinekb avatar Aug 29 '18 22:08 albinekb

@ThisIsSet-L Can you please specify setting for this? I tried to create new shortcut for Hyper in win10.

Hyper is starting with WSL bash by default and I want to have shortcut for CMD. I tried this: Target: C:\Users\petik\AppData\Local\hyper\Hyper.exe -e C:\Windows\System32\cmd.exe

But it doesn't work.

aka-raccoon avatar Sep 01 '18 18:09 aka-raccoon

Hey any news on this? I'm trying @chabou 's solution meanwhile

otonielguajardo avatar Sep 30 '18 07:09 otonielguajardo

I'd really like to see this too.

My use case is:

94% of the time I'm in WSL / Bash 5% of the time I need to run PowerShell as an admin (to work with Vagrant on Windows) 1% of the time I need to run PowerShell to manipulate various Windows properties

An ideal workflow (IMO) would be:

  1. You can default to a shell of your choosing (Bash), which hyper.js already does.
  2. When launching a new window / tab, it will use your default shell, which hyper-.js also does.
  3. Offer a "Shell" context menu to pick an alternate shell to override the default (bash, powershell, admin powershell, etc.).

The last one could be implemented in a number of ways:

  1. It could convert the current window / tab to the selected shell and while this is nice, it might be an issue if you tried to launch an admin / elevated shell since by default you're not using this. So you might be forced to open a new window? I'm not 100% sure how Windows permissions work.

  2. You could choose to launch either a new tab or new window with the selected shell. This might be the way to go since the behavior is the same in every case? And in the case of trying to launch a new tab with an elevated shell, that option could be hidden / disabled (unless it's possible to do this).

Then as for configuration, there would be multiple configuration paths for each shell type and you pick the one you want to use by default. The paths for each shell could also be filled out by default using the paths supplied in the current config option's comments, since they are valid for 90% of use cases.

The workaround I've been doing for now is just putting a PowerShell shortcut in my taskbar and launching that when needed since I rarely use it. It's not the end of the world but it would be really nice to have a unified terminal.

nickjj avatar Oct 18 '18 11:10 nickjj

Oh wow, hey, my workaround script is actually being used!

legowerewolf avatar Oct 19 '18 03:10 legowerewolf

What about supporting this though multiple profiles/configurations? For some shells I want some environment variables to be set for instance. This could be done by overriding the default config. Imagine config files listed in default config like this:

profiles: {
    bash: "bash.js"
    ubuntu: "wsl.js"
} 

Then this could be selected from the menu File > New window/tab > [ Default, bash, ubuntu ]

henning-erlandsen avatar Nov 22 '18 13:11 henning-erlandsen

I really want this feature too. In the meantime, here's my own hacky workaround for dealing with the lack of this necessary feature: https://gist.github.com/ronaldscott/5f8f7566277586a2b0a1d639000c4553

ronaldscott avatar Mar 15 '19 18:03 ronaldscott

Why is this still not implemented nearly 3 years later?

AaronBeaudoin avatar Nov 01 '19 01:11 AaronBeaudoin

@AaronBeaudoin because this is an open source project whose maintainers work on it on the side :+1:

matheuss avatar Nov 01 '19 01:11 matheuss

@AaronBeaudoin #1347 Addressed but it was never merged. There was some back-and-forth mostly over coding style consistency. Eventually, the OP of the PR moved on from Hyper as a tool, the PR got stale, and it was closed. This workaround https://github.com/zeit/hyper/issues/1147#issuecomment-381339196 has worked great for me.

szul avatar Nov 01 '19 11:11 szul

@matheuss I get the annoyance with @AaronBeaudoin's comment, but Hyper is one of the open source projects that Zeit frequently promotes, and there has been at least one PR that addressed this, but nobody from the team merged it or got back to the programmer's later comments after he resolved the change requests on the PR. This is probably the most frequent request from all Hyper users. Maybe a Hyper roadmap would help mitigate requests like this. Is one available publicly?

szul avatar Nov 01 '19 11:11 szul

@matheuss I think I might have come across the wrong way. My sentiment is simply that being a very popular and loved projects in its category, Hyper's community would benefit from, at the very least, some transparency on where the project is going.

My next thought was going to be whether it is worth contributing to the project myself, but considering @szul's insight I am hesitant to put time into a request that might not ever be merged. I believe that community contributions for highly requested features should be honored by addressing them in a matter of months... not years.

AaronBeaudoin avatar Nov 01 '19 13:11 AaronBeaudoin

@AaronBeaudoin I'm sure there are many reasons mergers don't go through: code quality, efficiency, priority, etc. I'm not faulting them for that. Zeit has a lot of great products, and they need to prioritize revenue generating work. This is a situation where not only is there a long-standing request for the feature, but also OS attempts to contribute the feature to the project, so it would be nice to know what the long-term roadmap for the project is, and where this feature stands in the priority, if at all. That would mitigate some of the "where is this at?" questions, which clearly solicited a knee-jerk reaction.

szul avatar Nov 01 '19 14:11 szul

Just a heads up, there is actually an extension that fixes this issue quite eloquently called "Hyper-Shellect". It's functionality is a lot like the workaround script from legowerewolf. Even though the original developer and their code have gone AWOL on Github, the extension is still available on npm (https://www.npmjs.com/package/hyper-shellect). The only problem I have encountered is that when you try to close a tab or pane with 'ctrl+alt+w', the extensions can make hyper crash, which is really something to be looked into.

Hariama avatar Apr 03 '20 18:04 Hariama

Another available extension is hyper-launch-menu. It works like a charm for me!

www-wagner avatar Jun 15 '20 21:06 www-wagner

@www-wagner Already Referenced it, but Hyper Launch Menu. Here's the official readme docs.

https://hyper.is/store/hyper-launch-menu/source?README.md

zhorton34 avatar Jul 25 '20 21:07 zhorton34

2022 and still not a single usable terminal emulator for windows

way to go!

snwflake avatar Jul 07 '22 17:07 snwflake