Index: contrib/drush_terminal/drush_terminal.terminal.inc
===================================================================
RCS file: contrib/drush_terminal/drush_terminal.terminal.inc
diff -N contrib/drush_terminal/drush_terminal.terminal.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ contrib/drush_terminal/drush_terminal.terminal.inc	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,36 @@
+<?php
+// $Id$
+
+/**
+ * Implementation of hook_terminal.
+ */
+function drush_terminal_terminal() {
+  $commands['drush'] = array(
+    'title' => t('Drush'),
+    'pattern' => 'drush help [command]',
+    'description' => t('Execute "drush help" for more information.'),
+    'callback' => 'drush_terminal_terminal_command',
+  );
+  return $commands;
+}
+
+/**
+ * Terminal callback; Executes a Drush command.
+ */
+function drush_terminal_terminal_command($args = array()) {
+  // Retrieve the required values.
+  $php = variable_get('drush_terminal_php', NULL);
+  $drush = variable_get('drush_terminal_drush', NULL);
+  $root = variable_get('drush_terminal_root', NULL);
+  if (!isset($php, $drush, $root)) {
+    echo t('You must visit admin/settings/drush_terminal and configure the module.');
+    exit;
+  }
+
+  // Invoke Drush.
+  $args = implode(' ', $args);
+  $output = array();
+  exec("$php $drush -r '$root' " . $args, $output);
+  $output = implode("\n", $output);
+  echo $output;
+}
Index: contrib/drush_terminal/drush_terminal.module
===================================================================
RCS file: contrib/drush_terminal/drush_terminal.module
diff -N contrib/drush_terminal/drush_terminal.module
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ contrib/drush_terminal/drush_terminal.module	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,44 @@
+<?php
+// $Id$
+
+/**
+ * Implementation of hook_menu().
+ */
+function drush_terminal_menu() {
+  $items['admin/settings/drush_terminal'] = array(
+    'title' => 'Drush Terminal',
+    'description' => 'Configure how the Terminal interacts with Drush.',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('drush_terminal_admin'),
+    'access arguments' => array('administer site configuration'),
+  );
+  return $items;
+}
+
+/**
+ * Menu callback; Creates the administration settings.
+ */
+function drush_terminal_admin() {
+  $form['drush_terminal_php'] = array(
+    '#type' => 'textfield',
+    '#title' => t('PHP Path'),
+    '#description' => t('The absolute path to PHP.'),
+    '#default_value' => variable_get('drush_terminal_php', 'php'),
+    '#required' => TRUE,
+  );
+  $form['drush_terminal_drush'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Drush Path'),
+    '#description' => t('The absolute path to <em>drush.php</em>.'),
+    '#default_value' => variable_get('drush_terminal_drush', ''),
+    '#required' => TRUE,
+  );
+  $form['drush_terminal_root'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Drupal Path'),
+    '#description' => t('The absolute path to the Drupal installation to use Drush on.'),
+    '#default_value' => variable_get('drush_terminal_root', dirname(realpath('index.php'))),
+    '#required' => TRUE,
+  );
+  return system_settings_form($form);
+}
Index: contrib/drush_terminal/drush_terminal.info
===================================================================
RCS file: contrib/drush_terminal/drush_terminal.info
diff -N contrib/drush_terminal/drush_terminal.info
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ contrib/drush_terminal/drush_terminal.info	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,4 @@
+; $Id: terminal.info,v 1.3 2009/06/09 20:26:23 snufkin Exp $
+name = Drush Terminal
+description = Adds Drush support to the Terminal.
+core = 6.x
