Warp icon indicating copy to clipboard operation
Warp copied to clipboard

Support subshells in Warp

Open thegedge opened this issue 4 years ago • 13 comments

Describe the bug When I exec my shell, which I sometimes do to reload the environment, Warp thinks it's a long running command and loses the ability to understand blocks.

To Reproduce Steps to reproduce the behavior:

  1. Run exec <shell>

Expected behavior Warp understands the shell was replaced by another shell, and still is able to do block I/O.

This applies to just running the shell without exec too. In that case, I wonder if Warp could somehow do "nested" blocks?

Screenshots exec bash

Desktop (please complete the following information):

  • MacOS 11.3.1

thegedge avatar Jul 24 '21 18:07 thegedge

Yeah i think the right UI for this is to continue doing blocks but with some indication that you are in a subshell, similar to how we handle ssh. This should be doable. Please upvote if you want it.

zachlloyd avatar Jul 24 '21 20:07 zachlloyd

Differentiating User Shells And Subshells

From @shankarshastri via #220

Describe the solution you'd like?

It would be great based on the context, to show to users that currently in shell or subshell mode (For example docker shell container id for docker exec, and in case of ssh to ssh and hostname)

Is your feature request related to a problem? Please describe.

It's always a challenge to know whether we are in actual shell or any subshells.

Additional context

No response

elviskahoro avatar Jan 20 '22 07:01 elviskahoro

Poetry (python) creates a subshell. Would be nice if this was supported as well.

elviskahoro avatar Jan 20 '22 08:01 elviskahoro

Are there any plans or roadmaps for supporting the sub-shell feature?

Liu-Da avatar Apr 11 '22 10:04 Liu-Da

Hi, in a ruby on rails console I have the same issue. Thanks for looking into it!

sweetyclem avatar Apr 13 '22 12:04 sweetyclem

From #949

Describe the bug

On the MBP v12.2.1 native terminal, when I open up `psql`,I can navigate via Option + Left/Right arrow and modify my queries, but this behavior isn't compatible in Warp. Instead, I just get a space in the shell.

To Reproduce

Steps to reproduce:

  1. Open psql
  2. Type out a query like select * from users
  3. Try to navigate via Option + Left Arrow to replace * with specific columns.
  4. See that the cursor is moved to the right for some reason 🤷.

Expected behaviour

I would expect to be moved to the next "word" in the direction of the arrow key I choose while holding Option.

Screenshots

No response

Operating System

MacOS

OS Version

12.2.1

Additional context

No response

elviskahoro avatar Apr 15 '22 07:04 elviskahoro

Having Warp work with DB subshells would be huge. Those are the places where we often have to type and edit very long commands and basically where Warp would bring a lot of value.

jwickers avatar Apr 19 '22 02:04 jwickers

Encountered the same issue in subshells:

  • mongo shell
  • mycli command line
  • ...

Currently, we can do the same things by

  • Esc + B to move cursor to the beginning of the current word
  • Esc + F to move cursor to the end of the current word
  • Ctrl + W to delete whole word

But, it's not convenient and friendly. Looking forward to the shortcuts support in subshells by OPTION/CMD + ARROW LEFT/RIGHT or BACKSPACE

junyicc avatar Jun 13 '22 10:06 junyicc

Just to add to the list of programs that would benefit from this, AWS's Elastic Beanstalk CLI. Specifically the eb ssh command

joeyparis avatar Jun 29 '22 14:06 joeyparis

Not sure if this is the same issue, but in micro some shortcuts also don't work. Notably Opt+Backspace to delete whole previous word, which only deletes one character. The shortcut works as expected in iTerm2 but not in Mac Terminal.

Opt+Left Arrow works in all three environments inside micro.

petrbouchal avatar Aug 05 '22 10:08 petrbouchal

I think I have another use case surfacing this issue. When using psql, the pager appears broken.

Eg in psql, when running a SELECT query, or doing something like \d <table name>, I very briefly see the results of the query, but then Warp scrolls downward at very quick speed (warp speed?) and all I get is a buffer full of

~
~
~
(END)

I can't scroll back up to see content.

If I first disable the pager in psql, eg \pset pager 0 then I don't get this behavior. Also, if I run this in another terminal program (eg the stock mac terminal program), I also don't get this behavior, so this does appear to be something specific to Warp and not my postgres installation.

pzoomin avatar Aug 24 '22 13:08 pzoomin

+1

ToontjeM avatar Sep 02 '22 11:09 ToontjeM

Not only that, but it's tremendously slow when navigating through text after doing exec <shell> and trying to edit a long command.

Soromeister avatar Sep 15 '22 19:09 Soromeister

There are plans but no ETA!

  • elvis

warpdotdev-devx avatar Oct 11 '22 06:10 warpdotdev-devx

Whenever developing (80% of my terminal use), I have to stop using Warp. Please share some update about the progress. A public alpha build so we can help test and give feedback. Can we see some slow but steady progress on this.

kchawla-pi avatar Oct 27 '22 16:10 kchawla-pi

I just heard about Warp today and started using it, but this is a pretty major setback. Definitely will try to use it as much as I can because the features are amazing, but I'd love to be able to use it 100% of the time rather than 15% of the time.

ocawthorne avatar Oct 29 '22 02:10 ocawthorne

I switch between shells a bit, so support for this would be great. Example is I use fish as my default shell, but at times need to switch to zsh/bash/powershell.

donwlewis avatar Oct 31 '22 16:10 donwlewis

I switch between shells a bit, so support for this would be great. Example is I use fish as my default shell, but at times need to switch to zsh/bash/powershell.

I don't think this is the same thing as that being requested in this thread. You are talking about different shell programs. The issue is for different virtual environments executed via sub-shells (but using the same shell program).

kchawla-pi avatar Nov 01 '22 17:11 kchawla-pi

@kchawla-pi Still no ETA on this feature. It's definitely something that's non-trivial.

@donwlewis -> @kchawla-pi is correct here. There are plans to create a generic shell if there are other shells you'd like to see supported outside of Bash, Zsh, Fish. Here's the link to that discussion: https://github.com/warpdotdev/Warp/discussions/64

elviskahoro avatar Nov 01 '22 19:11 elviskahoro

@elviskahoro Maybe I am misunderstanding, but I think this still qualifies because in my scenario, I am executing zsh/bash as a sub-shell within fish. Please correct me if I am wrong.

donwlewis avatar Nov 01 '22 20:11 donwlewis

OH I see. Thanks for clarifying! This is the right issue to keep an eye on. I'll let you know if we end up making smaller more specific sub-issues.

elviskahoro avatar Nov 02 '22 02:11 elviskahoro

Just plain sudo su - is also causing this.

taypo avatar Nov 10 '22 20:11 taypo

+1

James4Ever0 avatar Nov 12 '22 06:11 James4Ever0

As @taypo pointed out, this issue also impacts sudo, or su. Sometimes I just need to sudo into zsh or bash to do many tasks as root, rather than prefacing a thousand things with sudo, but, once I do invoke "sudo zsh" or "sudo bash", warp treats everything from that point on as one block. Defeats some of the point, and magic, of using Warp!

xyzzy314 avatar Nov 13 '22 03:11 xyzzy314

I got here from issue #807, so I'll just echo that request, to be able to use CMD or OPTION + arrow keys when in REPLs like pry, irb, etc. Blocks in subshells would be awesome! Thanks!

jmouka avatar Nov 16 '22 17:11 jmouka

This is also a problem with nix shell, where I install a new program only in a Childs zsh process, so the path inside of that is changed, therefor a new zsh has to be created.

kloenk avatar Nov 20 '22 13:11 kloenk

Comment from #2217

Pretty enjoy the IDE-style editor, especially the ability of selecting the text to delete it. So I'm wondering is it possible to support this feature in REPLs, e.g., python, psql, ... 🤔

dannyneira avatar Nov 23 '22 22:11 dannyneira

+1 without this feature, warp become useless in 90% of work

oleg-savko avatar Dec 02 '22 09:12 oleg-savko

As mentioned by others before sub shell support is desperately needed. I use containers running on my mac that provide me various tools with a fixed version and included dependencies for my daily work. Sadly Warp loses all its glory as soon as I enter a container shell (docker exec -it toolbox bash).

+1 to increase the priority of this feature.

By the way I'm a big fan and I would love to use warp as my go-to terminal.

siw36 avatar Dec 16 '22 07:12 siw36

+1 this is probably the most important feature that Warp is missing

dshpindler avatar Dec 18 '22 09:12 dshpindler