Skip to content

Commit 0fd56c7

Browse files
Add an 'ssh.tty' option to site aliased. (#3648)
* Add an 'ssh.tty' option to site aliased. Usually Drush decides whether or not to create a tty for remote ssh commands based on whether the current Drush command is running in interactive mode or not. When in interactive mode, a tty is created; otherwise, no tty is created. Sometimes, a remote server will not grant the ssh user the permission to create a tty. In this instance, it is possible to force Drush to never create a tty via this new option. * Allow ssh.tty to override interactive mode regardless of whether interactive is true or false.
1 parent e30df96 commit 0fd56c7

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

examples/example.site.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,14 @@
135135
# if you set a 'remote-host' value, and your remote OS is Windows, if you
136136
# do not set the 'OS' value, it will default to 'Linux' and could cause
137137
# unintended consequences, particularly when running 'drush sql-sync'.
138-
# - 'ssh': If the target requires special options, such as a non-
139-
# standard port, alternative identity file, or alternative
140-
# authentication method, the `option` entry under the `ssh` item may
141-
# contain a string of extra options that are used with the ssh command,
142-
# e.g. "-p 100"
138+
# - 'ssh': Contains settings used to control how ssh commands are generated
139+
# when running remote commands.
140+
# - 'options': Contains additional commandline options for the ssh command
141+
# itself, e.g. "-p 100"
142+
# - 'tty': Usually, Drush will decide whether or not to create a tty (via
143+
# the ssh '--t' option) based on whether the local Drush command is running
144+
# interactively or not. To force Drush to always or never create a tty,
145+
# set the 'ssh.tty' option to 'true' or 'false', respectively.
143146
# - 'paths': An array of aliases for common rsync targets.
144147
# Relative aliases are always taken from the Drupal root.
145148
# - 'files': Path to 'files' directory. This will be looked up if not

src/Runtime/RedispatchHook.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ public function redispatch(InputInterface $input)
9494
'additional-global-options' => [],
9595
'interactive' => true,
9696
];
97+
$backend_options['#tty'] = $this->getConfig()->get('ssh.tty', $input->isInteractive());
9798
if ($input->isInteractive()) {
98-
$backend_options['#tty'] = true;
9999
$backend_options['interactive'] = true;
100100
}
101101

0 commit comments

Comments
 (0)