From cd936ac6862d91c9e0a685953797baafc26a5a57 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 1 Jul 2014 10:00:29 -0400 Subject: [PATCH] feature(console) paste path of current directory on Ctrl + P --- HELP.md | 1 + lib/client/console.js | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/HELP.md b/HELP.md index 796e4e0e..bc8865bd 100644 --- a/HELP.md +++ b/HELP.md @@ -138,6 +138,7 @@ Console |Key |Operation |:----------------------|:-------------------------------------------- | `~` | open +| `Ctrl` + `P` | paste path of current directory | `Esc` | close Config diff --git a/lib/client/console.js b/lib/client/console.js index e317ce86..f5718051 100644 --- a/lib/client/console.js +++ b/lib/client/console.js @@ -68,6 +68,13 @@ var CloudCmd, Util, DOM, CloudFunc, $; jqconsole.AbortPrompt(); handler(); }); + + jqconsole.RegisterShortcut('P', function() { + var command = jqconsole.GetPromptText(); + + command += DOM.getCurrentDirPath(); + jqconsole.SetPromptText(command); + }); } CloudCmd.View.show(Element, {