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

Interactive SSH session as an option. #224

Open
artem-zinnatullin opened this issue May 22, 2018 · 12 comments
Open

Interactive SSH session as an option. #224

artem-zinnatullin opened this issue May 22, 2018 · 12 comments
Assignees

Comments

@artem-zinnatullin
Copy link
Contributor

Problem:

Build tools like Gradle and Buck can output build progress much nicely if run in interactive mode, ie Gradle and Buck will show interactive progress of parallel build which is much easier to look at compared to plain build log.

Solution:

To enable that properly we can pass -t option to ssh which will try to allocate pseudo-terminal thus properly setting TERM env variable so the command we're executing can detect interactive mode and react to that.

I think that should be a config and flag option.


Note that some tools allow you manually override that, ie gradle --console rich, however particularly with Gradle output gets messed up and basically freezes if underlying ssh session is not interactive.

I remember we discussed that internally, but can't remember why we decided to not add that option, @ming13 @dmitry-novikov do you remember details?

@bmc08gt
Copy link

bmc08gt commented Jun 1, 2018

-tt may be required as I was getting this running this from WSL (client)-> OSX (remote).

Pseudo-terminal will not be allocated because stdin is not a terminal.

adding -tt to the ssh command in the 2.1.0 script gave me back the beautiful gradle colors.

@artem-zinnatullin
Copy link
Contributor Author

Right, I also use -tt in my version :)

@bmc08gt
Copy link

bmc08gt commented Jun 1, 2018

:) Are you guys accepting PR's on the 2.1.X script?

@artem-zinnatullin
Copy link
Contributor Author

Although, looks like some escape characters slip through and break my terminal session, for example git status after running interactive Mainframer prints output with broken tabulation (everything is shifted to the right)

@bmc08gt have you noticed something like this?

@Pozzoooo
Copy link

Pozzoooo commented Jun 1, 2018

I've been using with interactive mode for a while now (only -t in my case) with the old bash mainframer, haven't got any issue, another advantage is Ctrl+C being sent to the remote machine

@artem-zinnatullin
Copy link
Contributor Author

@bmc08gt nope, 2.x is frozen, particularly this feature requires configuration options (not everyone might want it), so it's not just adding -tt to ssh call

@artem-zinnatullin
Copy link
Contributor Author

@Pozzoooo Ctrl + C can be supported even in non-interactive mode in 3.x, but I'm still unsure if we need to, sometimes I want to keep remote machine doing what I started even if I stop Mainframer locally

@Pozzoooo
Copy link

Pozzoooo commented Jun 1, 2018

for that case I would suggest "&" or Ctrl + Z.... it might be me, but I quite often remember I forgot to change something just after hitting enter to compile

@artem-zinnatullin
Copy link
Contributor Author

Fair 👍

@artem-zinnatullin
Copy link
Contributor Author

The caveat here is that in interactive mode, remote machine can start emitting escape symbols that slip through Mainframer and break Terminal state on local machine

I've had this with running Gradle, where local machine was macOS and remove was Linux.

The problem is described and discussed here: https://github.com/rust-lang-nursery/cli-wg/issues/57#issue-346366222

@artem-zinnatullin artem-zinnatullin removed this from the v3.0.0 milestone Oct 15, 2018
@MVMS1994
Copy link

+1 for this enhancement.
I worked around to get nodejs run on the remote machine with mainframer. And to enable colors, I locally added -t

@cococolanosugar
Copy link

+1 for this enhancement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants