Closed (won't fix)
Project:
Drush
Version:
8.x-6.x-dev
Component:
Base system (internal API)
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
9 May 2013 at 16:14 UTC
Updated:
11 Sep 2013 at 11:44 UTC
Comments
Comment #1
greg.1.anderson commentedWith this patch, non-interactive commands now say:
It can also get worse; for example, on one site, I get this with the patch above applied:
The same command works fine without this patch (no -t option passed to ssh).
Basically, what is going on above is that allocating the terminal causes the initialization of the shell to be done differently; even though Drush is working fine with a regular ssh session, and even though it works without this patch, with the terminal allocated, the wrong version (an older version) of PHP is selected, and some class-related code in Drush Deploy is reported as a syntax error. While this is essentially a problem with the configuration of my one host, it is not evidenced under normal circumstances, and the cause is subtle.
For both of these reasons, I think this is not a desirable change. We should find a way to allocate a termi
nal conditionally, only if the remote command needs it (i.e., is interactive).
I will introduce conditional use of -t in #1982274: Allow cd root first for the ssh command, and we can continue here for other interactive commands.
Comment #2
greg.1.anderson commentedI have not tried this yet, but it looks like if you put a command-specific option 'tty' in your site alias (e.g. for sql-cli), then the -t will be added.Comment #3
greg.1.anderson commentedTo determine whether a command should get a tty or not, you'd have to parse the arguments of the drush ssh command. This isn't really convenient.
Folks who want -t to be the default can set
$command_specific['ssh']['tty'] = TRUE;in a drushrc.php file.A patch to add this functionality to _drush_backend_generate_command would be welcome, if it is needed. Any ideas on how to determine when to allocate a tty would also be welcome.
Comment #4
deviantintegral commented-q looks to hide that message.
I'm thinking instead of trying to parse the string (which gets hairy with command flags), I wonder if we could add something to hook_drush_commands() that indicates the command needs a TTY. If that's set, whenever a command is piped through SSH we add -tq to the command. Thoughts?
Comment #5
greg.1.anderson commentedThe thing is, if you are running an ssh command, the final target command appears only in the command args to ssh; hook_drush_commands is not involved until after you have dispatched through ssh (that is, the hook that you want to run executes on the remote target machine, not your local machine).
Comment #6
greg.1.anderson commentedThis issue was marked
closed (won't fix)because Drush has moved to Github.If this feature is still desired, you may copy it to our Github project. For best results, create a Pull Request that has been updated for the master branch. Post a link here to the PR, and please also change the status of this issue to
closed (duplicate).Please ask support questions on Drupal Answers.