Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for multiple shells #1147

Closed
atrauzzi opened this issue Dec 12, 2016 · 43 comments · Fixed by #7301
Closed

Support for multiple shells #1147

atrauzzi opened this issue Dec 12, 2016 · 43 comments · Fixed by #7301
Labels
💬 Feedback Wanted Issue or PR needs input from the community! Lend your thoughts ✨ 🛠 Type: Feature Request Issue or PR is a feature request/proposal for Hyper

Comments

@atrauzzi
Copy link

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 :)

@ppot ppot added the 💬 Feedback Wanted Issue or PR needs input from the community! Lend your thoughts ✨ label Dec 14, 2016
@ekinnee
Copy link

ekinnee commented Dec 20, 2016

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.

@lllama
Copy link

lllama commented Jan 9, 2017

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)

@matheuss
Copy link
Member

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) 😄

@lllama
Copy link

lllama commented Jan 21, 2017

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.

@lediur
Copy link

lediur commented Mar 7, 2017

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

@ehdevries
Copy link

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

@MartyGentillon
Copy link
Contributor

related pull request: #1347

@szul
Copy link

szul commented Apr 22, 2017

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

@fallspectrum
Copy link

Agreed.

@doppleware
Copy link

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)

@resir014
Copy link

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.

@tobico
Copy link

tobico commented Aug 11, 2017

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.

@ppot
Copy link
Contributor

ppot commented Aug 13, 2017

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

@atrauzzi
Copy link
Author

atrauzzi commented Feb 4, 2018

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.

@hsiktas
Copy link

hsiktas commented Feb 17, 2018

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/

@JustSid
Copy link

JustSid commented Mar 16, 2018

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.

@blackwire
Copy link

blackwire commented Mar 23, 2018

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?

@atrauzzi
Copy link
Author

Not really because I start with bash :)

@blackwire
Copy link

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.

@atrauzzi
Copy link
Author

atrauzzi commented Mar 24, 2018

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

Workarounds run the risk of derailing this ticket.

@szmarczak
Copy link

Any news?

@chabou
Copy link
Contributor

chabou commented Apr 14, 2018

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

I hope that it will be a plugin soon 🤞

@Stanzilla Stanzilla changed the title Multiple shells Support for multiple shells Apr 23, 2018
@Stanzilla Stanzilla added the 🛠 Type: Feature Request Issue or PR is a feature request/proposal for Hyper label Apr 23, 2018
@marcinfigiel
Copy link

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

@ctolkien
Copy link

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.

@CosmicToast
Copy link

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)

@ThisIsSet-L
Copy link

ThisIsSet-L commented Aug 29, 2018

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.

@albinekb
Copy link
Contributor

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

@aka-raccoon
Copy link

@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.

@otonielguajardo
Copy link

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

@nickjj
Copy link

nickjj commented Oct 18, 2018

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.

@legowerewolf
Copy link

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

@henning-erlandsen
Copy link

henning-erlandsen commented Nov 22, 2018

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 ]

@ronaldscott
Copy link

ronaldscott commented Mar 15, 2019

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

@AaronBeaudoin
Copy link

Why is this still not implemented nearly 3 years later?

@matheuss
Copy link
Member

matheuss commented Nov 1, 2019

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

@szul
Copy link

szul commented Nov 1, 2019

@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 #1147 (comment) has worked great for me.

@szul
Copy link

szul commented Nov 1, 2019

@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?

@AaronBeaudoin
Copy link

@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.

@szul
Copy link

szul commented Nov 1, 2019

@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.

@Hariama
Copy link

Hariama commented Apr 3, 2020

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.

@www-wagner
Copy link

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

@zhorton34
Copy link

@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

@snwflake
Copy link

snwflake commented Jul 7, 2022

2022 and still not a single usable terminal emulator for windows

way to go!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💬 Feedback Wanted Issue or PR needs input from the community! Lend your thoughts ✨ 🛠 Type: Feature Request Issue or PR is a feature request/proposal for Hyper
Projects
None yet
Development

Successfully merging a pull request may close this issue.