aptible / aptible-cli

Command line interface to Aptible
MIT License
28 stars 35 forks source link

aptible ssh: Correct TTY handling #217

Closed krallin closed 7 years ago

krallin commented 7 years ago

SSH's default behavior is as follows:

Unfortunately, in our case, this breaks, because we use a forced-command, so we don't ever send a command, which causes SSH to always allocate TTY, which causes a variety of problems, not least of which is that stdout and stderr end up merged.

Now, it's pretty common for Aptible users to run commands in their container with the intention of using a TTY (by e.g. running aptible ssh bash), so we use a slightly different heuristic from SSH: we allocate TTY iif there's no input or output redirection going on.

End users can always override this behavior with the --force-tty option.


cc @fancyremarker

codecov-io commented 7 years ago

Codecov Report

Merging #217 into master will increase coverage by 0.59%.

@@            Coverage Diff             @@
##           master     #217      +/-   ##
==========================================
+ Coverage   90.55%   91.15%   +0.59%     
==========================================
  Files          43       44       +1     
  Lines        1440     1481      +41     
==========================================
+ Hits         1304     1350      +46     
+ Misses        136      131       -5
Impacted Files Coverage Δ
spec/aptible/cli/subcommands/ssh_spec.rb 100% <100%> (ø)
lib/aptible/cli/subcommands/ssh.rb 100% <100%> (+30.43%) :white_check_mark:
lib/aptible/cli/helpers/tunnel.rb 90.19% <ø> (-3.93%) :x:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 40900dc...4fe3b45. Read the comment docs.