Bug 398905 - Shouldn't have to copy&paste the Debug URL
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/urlUtils.js b/bundles/org.eclipse.orion.client.ui/web/orion/urlUtils.js
index b584f48..c57f617 100644
--- a/bundles/org.eclipse.orion.client.ui/web/orion/urlUtils.js
+++ b/bundles/org.eclipse.orion.client.ui/web/orion/urlUtils.js
@@ -51,7 +51,7 @@
 	 *     segmentStr: String. The string in the segment.
 	 *     isValidURL: Boolean. The flag indicating if the segment is a valid URL.
 	 */
-	function rendeStrSegments(parentNode, segments) {
+	function processURLSegments(parentNode, segments) {
 		segments.forEach(function(segment) {
 			if(segment.isValidURL){
 				var link = document.createElement('a');
@@ -69,6 +69,6 @@
 	//return module exports
 	return {
 		detectValidURL: detectValidURL,
-		rendeStrSegments: rendeStrSegments
+		processURLSegments: processURLSegments
 	};
 });
diff --git a/bundles/org.eclipse.orion.client.ui/web/shell/resultWriters.js b/bundles/org.eclipse.orion.client.ui/web/shell/resultWriters.js
index 36db8a8..b938df9 100644
--- a/bundles/org.eclipse.orion.client.ui/web/shell/resultWriters.js
+++ b/bundles/org.eclipse.orion.client.ui/web/shell/resultWriters.js
@@ -13,7 +13,7 @@
 /*global define*/

 /*jslint browser:true*/

 

-define(["orion/Deferred"], function(Deferred) {

+define(['orion/Deferred', 'orion/urlUtils'], function(Deferred, mUrlUtils) {

 

 	var orion = {};

 	orion.shellPage = {};

@@ -124,7 +124,12 @@
 			},

 			appendText: function(text) {

 				var node = document.createElement("span"); //$NON-NLS-0$

-				node.textContent = text;

+				var segments = mUrlUtils.detectValidURL(text);

+				if(segments){

+					mUrlUtils.processURLSegments(node, segments);				

+				} else {

+					node.textContent = text;

+				}

 				this.tempRoot.appendChild(node);

 			},

 			write: function() {

diff --git a/modules/orionode/lib/node_apps.js b/modules/orionode/lib/node_apps.js
index 19b15ea..568ba08 100644
--- a/modules/orionode/lib/node_apps.js
+++ b/modules/orionode/lib/node_apps.js
@@ -63,7 +63,8 @@
 App.prototype.decorators = [
 	function debugDecorator(app, json) {
 		if (app.debug) {
-			json.DebugURL = app.debug;
+			//The debugURL property has to be enclosed by "[" and "]" so that it can be parsed as a link instead of plain text, on client side.
+			json.DebugURL = "[" + app.debug + "]";
 		}
 	}
 ];
@@ -245,7 +246,6 @@
 	 */
 	this.startApp = function(modulePath, args, context, hidden) {
 		var cwdPath = _resolveCWD(fileRoot, workspaceDir, context.cwd);
-		debugger;
 		modulePath = resolveModulePath(workspaceDir, cwdPath, modulePath);
 		var app = _startApp([modulePath].concat(args || []), cwdPath, hidden);
 		app.on('exit', function(code) {
@@ -264,7 +264,7 @@
 		var app = _startApp(["--debug-brk=" + port, resolvedPath].concat(args || []), cwdPath);
 		var parsedRequestUrl = url.parse(requestUrl);
 		app.debug = url.format({
-			protocol: parsedRequestUrl.protocol,
+			protocol: 'http',//parsedRequestUrl.protocol,
 			// TODO this is bizarre. Can we host node-inspector on the same port as Orionode?
 			hostname: url.parse('http://' + headers.host).hostname,
 			port:  INSPECT_PORT,