Home Dashboard Directory Help
Search

New richer console with mouse-select, copy+paste etc.. by Graimer0


Status: 

Active


3
0
Sign in
to vote
Type: Suggestion
ID: 777001
Opened: 1/20/2013 5:05:58 AM
Access Restriction: Public
1
Workaround(s)
view

Description

There may be a few other suggestions about this already, but I couldn't find one that fit perfectly.

I would like the powershell console to be replaced. It's a tragedy that a new command-line shell still uses the old conhost.exe/command/cmd console. I would like the ability to:

- Resize windows (width)
- Mouse select. You can select, but it should mark the text, not blocks. Now when i want to copy a command I wrote, I need to select ex. two rows, copy to notepad, remove shell prompt (PS >) and linebreaks to get my command. This is way to hard.
- Copy, cut and paste using CTRL+C, CTRL+X and CTRL+V.
- As far as I know it isn't full customizable from the script. Ex. to set colors or width of console, you need to enter Properties for the console windows or edit the properties in the shortcut.

Powershell ISE already has most of this in it's console, so why doesn't the powershell console have it? This is like having a sports car only to drive it in 5mph.
Details
Sign in to post a comment.
Posted by S.K. _ on 5/24/2013 at 4:52 AM

Posted by S.K. _ on 4/15/2013 at 6:46 AM
I tryed to making select with shiftkey, CTRL+C, CTRL+X and CTRL+V function with PSHostConsoleReadLine.
http://gallery.technet.microsoft.com/scriptcenter/WindowsKeyBinding-for-60fb0d55
Posted by Graimer0 on 1/23/2013 at 6:53 AM
Thanks for the temporary workaround. Still, it should be replaced in the next version of PS. It's time to seperate the new from the old. :-)
Posted by S.K. _ on 1/20/2013 at 8:22 AM
you can copy/cut/pase on powershell using custom tab completion function(TabExpansion).
Sign in to post a workaround.
Posted by S.K. _ on 1/20/2013 at 8:21 AM
workaround CTRL+X and CTRL+V with Tab completion

* this is a part of http://gallery.technet.microsoft.com/scriptcenter/005d8bc7-5163-4a25-ad0d-25cffa90faf5 *

how to use:

PS > verylonglonglonglonglonglonglonglonglogcommandline<CTRL+X><TAB> # cut
PS > <CTRL+V><TAB> # paste

function TabExpansion {

param($line, $lastWord)

switch ([int]$line[-1]) {
# Ctrl+X+<TAB> cut current line
24 {
     $_clip = new-object System.Windows.Forms.TextBox;
     $_clip.Multiline = $true;
     $_clip.Text = $line.SubString(0, $line.Length-1)
     $_clip.SelectAll()
     $_clip.Copy()
     [System.Windows.Forms.SendKeys]::SendWait("{ESC}")
     break TabExpansion;
}

# Ctrl+V+<TAB> paste clipboard
22 {
     $_base = $lastword.SubString(0, $lastword.Length-1)
     $global:_clip = New-Object System.Windows.Forms.TextBox
     $global:_clip.Multiline = $true
     $global:_clip.Paste()
     $line = ($line.SubString(0, $line.Length-1) + $global:_clip.Text) -replace '([[\]\(\)+{}?~%])','{$1}'
     [System.Windows.Forms.SendKeys]::SendWait("{Esc}$line")
     break TabExpansion;
}
}
}