diff --git a/concfg.sublime-project b/concfg.sublime-project index d91c0e1..f96e92d 100644 --- a/concfg.sublime-project +++ b/concfg.sublime-project @@ -9,6 +9,6 @@ "settings": { "default_line_ending": "windows", "tab_size": 4, - "translate_tabs_to_spaces": true + "translate_tabs_to_spaces": false } } diff --git a/lib/commands.ps1 b/lib/commands.ps1 index e319890..5f8eff5 100644 --- a/lib/commands.ps1 +++ b/lib/commands.ps1 @@ -1,13 +1,13 @@ function command_files { - gci ("$psscriptroot\..\libexec") | where { $_.name.endswith('.ps1') } + gci ("$psscriptroot\..\libexec") | where { $_.name.endswith('.ps1') } } function commands { - command_files | % { command_name $_ } + command_files | % { command_name $_ } } function command_name($filename) { $filename.name -replace '\.ps1$', '' } function exec($cmd, $arguments) { - & ("$psscriptroot\..\libexec\$cmd.ps1") @arguments + & ("$psscriptroot\..\libexec\$cmd.ps1") @arguments } \ No newline at end of file diff --git a/lib/core.ps1 b/lib/core.ps1 index 62d40e3..a2194cd 100644 --- a/lib/core.ps1 +++ b/lib/core.ps1 @@ -7,27 +7,27 @@ $colors = 'black,dark_blue,dark_green,dark_cyan,dark_red,dark_magenta,dark_yellow,gray,dark_gray,blue,green,cyan,red,magenta,yellow,white'.split(',') $map = @{ - 'FontFamily'=@('font_true_type', 'font_type') - 'FaceName'=@('font_face', 'string') - 'FontSize'=@('font_size', 'dim') - 'FontWeight'=@('font_weight','int') - 'CursorSize'=@('cursor_size','cursor') - 'QuickEdit'=@('quick_edit', 'bool') - 'ScreenBufferSize'=@('screen_buffer_size', 'dim') - 'WindowSize'=@('window_size', 'dim') - 'PopupColors'=@('popup_colors', 'fg_bg') - 'ScreenColors'=@('screen_colors', 'fg_bg') - 'FullScreen'=@('fullscreen','bool') - 'HistoryBufferSize'=@('command_history_length','int') - 'NumberOfHistoryBuffers'=@('num_history_buffers','int') - 'InsertMode'=@('insert_mode','bool') - 'LoadConIme'=@('load_console_IME','bool') + 'FontFamily'=@('font_true_type', 'font_type') + 'FaceName'=@('font_face', 'string') + 'FontSize'=@('font_size', 'dim') + 'FontWeight'=@('font_weight','int') + 'CursorSize'=@('cursor_size','cursor') + 'QuickEdit'=@('quick_edit', 'bool') + 'ScreenBufferSize'=@('screen_buffer_size', 'dim') + 'WindowSize'=@('window_size', 'dim') + 'PopupColors'=@('popup_colors', 'fg_bg') + 'ScreenColors'=@('screen_colors', 'fg_bg') + 'FullScreen'=@('fullscreen','bool') + 'HistoryBufferSize'=@('command_history_length','int') + 'NumberOfHistoryBuffers'=@('num_history_buffers','int') + 'InsertMode'=@('insert_mode','bool') + 'LoadConIme'=@('load_console_IME','bool') } for($i=0;$i -lt $colors.length;$i++) { - $map.add("ColorTable$($i.tostring('00'))", @($colors[$i],'color')) + $map.add("ColorTable$($i.tostring('00'))", @($colors[$i],'color')) } $reverse_map = @{} foreach($key in $map.keys) { - $name,$type = $map[$key] - $reverse_map.add($name, @($key,$type)) + $name,$type = $map[$key] + $reverse_map.add($name, @($key,$type)) } \ No newline at end of file diff --git a/lib/help.ps1 b/lib/help.ps1 index 72d12c0..445c588 100644 --- a/lib/help.ps1 +++ b/lib/help.ps1 @@ -1,16 +1,16 @@ function usage($text) { - $text | sls '(?m)^# Usage: ([^\n]*)$' | % { "usage: " + $_.matches[0].groups[1].value } + $text | sls '(?m)^# Usage: ([^\n]*)$' | % { "usage: " + $_.matches[0].groups[1].value } } function summary($text) { - $text | sls '(?m)^# Summary: ([^\n]*)$' | % { $_.matches[0].groups[1].value } + $text | sls '(?m)^# Summary: ([^\n]*)$' | % { $_.matches[0].groups[1].value } } function help($text) { - $help_lines = $text | sls '(?ms)^# Help:(.(?!^[^#]))*' | % { $_.matches[0].value; } - $help_lines -replace '(?ms)^#\s?(Help: )?', '' + $help_lines = $text | sls '(?ms)^# Help:(.(?!^[^#]))*' | % { $_.matches[0].value; } + $help_lines -replace '(?ms)^#\s?(Help: )?', '' } function my_usage { # gets usage for the calling script - usage (gc $myInvocation.PSCommandPath -raw) + usage (gc $myInvocation.PSCommandPath -raw) } \ No newline at end of file diff --git a/lib/shortcut.ps1 b/lib/shortcut.ps1 new file mode 100644 index 0000000..3aa2c32 --- /dev/null +++ b/lib/shortcut.ps1 @@ -0,0 +1,11 @@ +function linksto($path, $target) { + if(!(test-path $path)) { return $false } + if($path -notmatch '\.lnk$') { return $false } + + $path = "$(resolve-path $path)" + + $shell = new-object -com wscript.shell -strict + $shortcut = $shell.createshortcut($path) + + return $shortcut.targetpath -eq $target +} diff --git a/libexec/export.ps1 b/libexec/export.ps1 index 473922e..277cf24 100644 --- a/libexec/export.ps1 +++ b/libexec/export.ps1 @@ -6,57 +6,57 @@ param($path) function decode($val, $type) { - switch($type) { - 'bool' { [bool]$val } - 'color' { - $bytes = [bitconverter]::getbytes($val) - [array]::reverse($bytes) - $int = [bitconverter]::toint32($bytes, 0) + switch($type) { + 'bool' { [bool]$val } + 'color' { + $bytes = [bitconverter]::getbytes($val) + [array]::reverse($bytes) + $int = [bitconverter]::toint32($bytes, 0) - '#' + $int.tostring('x8').substring(0,6) - } - 'cursor' { - switch($val) { - 0x19 { 'small' } - 0x32 { 'medium' } - 0x64 { 'large' } - } - } - 'fg_bg' { - $hex = $val.tostring('x2') - $bg_i = [convert]::toint32($hex[0],16) - $fg_i = [convert]::toint32($hex[1],16) - $bg = $colors[$bg_i] - $fg = $colors[$fg_i] - "$fg,$bg" - } - 'font_type' { ($val -gt 0) } - 'int' { $val } - 'string' { $val } - 'dim' { - $bytes = [bitconverter]::getbytes($val) - $width = [bitconverter]::toint16($bytes[0..2], 0) - $height = [bitconverter]::toint16($bytes, 2) - "$($width)x$($height)" - } - } + '#' + $int.tostring('x8').substring(0,6) + } + 'cursor' { + switch($val) { + 0x19 { 'small' } + 0x32 { 'medium' } + 0x64 { 'large' } + } + } + 'fg_bg' { + $hex = $val.tostring('x2') + $bg_i = [convert]::toint32($hex[0],16) + $fg_i = [convert]::toint32($hex[1],16) + $bg = $colors[$bg_i] + $fg = $colors[$fg_i] + "$fg,$bg" + } + 'font_type' { ($val -gt 0) } + 'int' { $val } + 'string' { $val } + 'dim' { + $bytes = [bitconverter]::getbytes($val) + $width = [bitconverter]::toint16($bytes[0..2], 0) + $height = [bitconverter]::toint16($bytes, 2) + "$($width)x$($height)" + } + } } function export_json { - $props = @{} - (gp hkcu:\console).psobject.properties | sort name |% { - $name,$type = $map[$_.name] - if($name) { - $props.add($name, (decode $_.value $type)) - } - } + $props = @{} + (gp hkcu:\console).psobject.properties | sort name |% { + $name,$type = $map[$_.name] + if($name) { + $props.add($name, (decode $_.value $type)) + } + } - $props | convertto-json + $props | convertto-json } $json = export_json if($path) { - $json | out-file $path -encoding utf8 - write-host "console settings exported to $(split-path $path -leaf)" -f darkgreen + $json | out-file $path -encoding utf8 + write-host "console settings exported to $(split-path $path -leaf)" -f darkgreen } else { $json } \ No newline at end of file diff --git a/libexec/help.ps1 b/libexec/help.ps1 index aeb816f..33689f5 100644 --- a/libexec/help.ps1 +++ b/libexec/help.ps1 @@ -7,41 +7,41 @@ param($cmd) . "$psscriptroot\..\lib\help.ps1" function print_help($cmd) { - $file = gc ("$psscriptroot\$cmd.ps1") -raw + $file = gc ("$psscriptroot\$cmd.ps1") -raw - $usage = usage $file - $summary = summary $file - $help = help $file + $usage = usage $file + $summary = summary $file + $help = help $file - if($usage) { "$usage`n" } - if($help) { $help } + if($usage) { "$usage`n" } + if($help) { $help } } function print_summaries { - $commands = @{} + $commands = @{} - command_files | % { - $command = command_name $_ - $summary = summary (gc ("$psscriptroot\$_") -raw ) - if(!($summary)) { $summary = '' } - $commands.add("$command ", $summary) # add padding - } + command_files | % { + $command = command_name $_ + $summary = summary (gc ("$psscriptroot\$_") -raw ) + if(!($summary)) { $summary = '' } + $commands.add("$command ", $summary) # add padding + } - $commands.getenumerator() | sort name | ft -hidetablehead -autosize -wrap + $commands.getenumerator() | sort name | ft -hidetablehead -autosize -wrap } $commands = commands if(!($cmd)) { - "usage: concfg [ [' to get help for a specific command" + print_summaries + "type 'concfg help ' to get help for a specific command" } elseif($commands -contains $cmd) { - print_help $cmd + print_help $cmd } else { - "concfg help: no such command '$cmd'"; exit 1 + "concfg help: no such command '$cmd'"; exit 1 } exit 0 diff --git a/libexec/import.ps1 b/libexec/import.ps1 index a4d9ef0..94d05d7 100644 --- a/libexec/import.ps1 +++ b/libexec/import.ps1 @@ -12,97 +12,97 @@ . "$psscriptroot\..\lib\help.ps1" function encode($val, $type) { - switch($type) { - 'bool' { if($val) { 1 } else { 0 } } - 'color' { - if($val -notmatch '^#[\da-f]{6}$') { - write-host "ERROR: invalid color '$val', should be in hex format, e.g. #000000" -f r - exit 1 - } - $num = [convert]::toint32($val.substring(1,6), 16) - $bytes = [bitconverter]::getbytes($num) - for($i = 3; $i -gt 0; $i--) { $bytes[$i] = $bytes[$i-1] } - $bytes[0] = 0 - [array]::reverse($bytes) - [bitconverter]::toint32($bytes, 0) - } - 'cursor' { - switch($val) { - 'small' { 0x19 } - 'medium' { 0x32 } - 'large' { 0x64 } - default { - write-host "WARNING: invalid cursor_size '$val', defaulting to 'small'" -f yellow - 0x19 - } - } - } - 'fg_bg' { - $fg,$bg = $val.split(',') - if(!$fg -or !$bg) { write-host "invalid foreground,background: $val" -f red; exit 1 } - $fg_i = $colors.indexof($fg) - $bg_i = $colors.indexof($bg) - if($fg_i -eq -1) { write-host "invalid foreground color: $fg" -f red; exit 1 } - if($bg_i -eq -1) { write-host "invalid background color: $bg" -f red; exit 1 } - $bg_i * 16 + $fg_i - } - 'font_type' { - if($val) { 54 } else { 0 } - } - 'int' { $val } - 'string' { $val } - 'dim' { - if($val -notmatch '^\d+x\d+$') { write-host "invalid dimensions '$val'" -f red; exit 1} - $width, $height = $val.split('x') | % { [int16]::parse($_) } - $width_b = [bitconverter]::getbytes($width) - $height_b = [bitconverter]::getbytes($height) - [byte[]]$bytes = @($width_b[0], $width_b[1], $height_b[0], $height_b[1]) - "$([bitconverter]::toint32($bytes, 0))" - } - } + switch($type) { + 'bool' { if($val) { 1 } else { 0 } } + 'color' { + if($val -notmatch '^#[\da-f]{6}$') { + write-host "ERROR: invalid color '$val', should be in hex format, e.g. #000000" -f r + exit 1 + } + $num = [convert]::toint32($val.substring(1,6), 16) + $bytes = [bitconverter]::getbytes($num) + for($i = 3; $i -gt 0; $i--) { $bytes[$i] = $bytes[$i-1] } + $bytes[0] = 0 + [array]::reverse($bytes) + [bitconverter]::toint32($bytes, 0) + } + 'cursor' { + switch($val) { + 'small' { 0x19 } + 'medium' { 0x32 } + 'large' { 0x64 } + default { + write-host "WARNING: invalid cursor_size '$val', defaulting to 'small'" -f yellow + 0x19 + } + } + } + 'fg_bg' { + $fg,$bg = $val.split(',') + if(!$fg -or !$bg) { write-host "invalid foreground,background: $val" -f red; exit 1 } + $fg_i = $colors.indexof($fg) + $bg_i = $colors.indexof($bg) + if($fg_i -eq -1) { write-host "invalid foreground color: $fg" -f red; exit 1 } + if($bg_i -eq -1) { write-host "invalid background color: $bg" -f red; exit 1 } + $bg_i * 16 + $fg_i + } + 'font_type' { + if($val) { 54 } else { 0 } + } + 'int' { $val } + 'string' { $val } + 'dim' { + if($val -notmatch '^\d+x\d+$') { write-host "invalid dimensions '$val'" -f red; exit 1} + $width, $height = $val.split('x') | % { [int16]::parse($_) } + $width_b = [bitconverter]::getbytes($width) + $height_b = [bitconverter]::getbytes($height) + [byte[]]$bytes = @($width_b[0], $width_b[1], $height_b[0], $height_b[1]) + "$([bitconverter]::toint32($bytes, 0))" + } + } } function preset($name) { - if(!$name.endswith('.json')) { $name = "$name.json" } - $x = "$psscriptroot\..\presets\$name" - if(test-path $x) { gc $x -raw } + if(!$name.endswith('.json')) { $name = "$name.json" } + $x = "$psscriptroot\..\presets\$name" + if(test-path $x) { gc $x -raw } } function text($src) { - # url - if($src -match '^https?://') { return (new-object net.webclient).downloadstring($src) } - - # local file path - if(test-path $src) { return gc $src -raw } - - # preset - preset $src - + # url + if($src -match '^https?://') { return (new-object net.webclient).downloadstring($src) } + + # local file path + if(test-path $src) { return gc $src -raw } + + # preset + preset $src + } function import_json($json) { - $props = $json | convertfrom-json + $props = $json | convertfrom-json - # encode everything first before setting registry values, in case - # anything goes wrong - $encoded = @{} + # encode everything first before setting registry values, in case + # anything goes wrong + $encoded = @{} - $props.psobject.properties | % { - $key,$type = $reverse_map[$_.name] - $val = $_.value - if($key) { $encoded[$key] = (encode $val $type) } - } + $props.psobject.properties | % { + $key,$type = $reverse_map[$_.name] + $val = $_.value + if($key) { $encoded[$key] = (encode $val $type) } + } - $encoded.keys | % { - sp hkcu:\console $_ $encoded[$_] - } + $encoded.keys | % { + sp hkcu:\console $_ $encoded[$_] + } } # flattens $args in case commas were used to separate sources function get_sources($a) { - $srcs = @() - $a | % { $srcs += $_ } - $srcs + $srcs = @() + $a | % { $srcs += $_ } + $srcs } if($args.length -eq 0) { "ERROR: source missing"; my_usage; exit 1 } @@ -110,32 +110,32 @@ if($args.length -eq 0) { "ERROR: source missing"; my_usage; exit 1 } $srcs = @(get_sources $args) foreach($s in $srcs) { - $json = text $s + $json = text $s - if(!$json) { "ERROR: couldn't load settings from $s"; exit 1 } + if(!$json) { "ERROR: couldn't load settings from $s"; exit 1 } - import_json $json - write-host "console settings were imported from $s" -f darkgreen + import_json $json + write-host "console settings were imported from $s" -f darkgreen } write-host " *** note: if you start a new console from a shortcut (.lnk), it may override - your concfg settings. + your concfg settings. " if(gci hkcu:console) { - write-host " + write-host " there are program-specific overrides in the registry that might interfere with your concfg settings." -f darkyellow - $yn = read-host "would you like to remove them? (Y/n)" - if(!$yn -or ($yn -like 'y*')) { - & "$psscriptroot\clean.ps1" - write-host "registry overrides removed" -f darkgreen - } else { - write-host " + $yn = read-host "would you like to remove them? (Y/n)" + if(!$yn -or ($yn -like 'y*')) { + & "$psscriptroot\clean.ps1" + write-host "registry overrides removed" -f darkgreen + } else { + write-host " ok. if you change your mind later you can run `concfg clean` to remove the overrides" - } + } } $yn = read-host "would you like to open a new console to see the changes? (Y/n)" diff --git a/libexec/presets.ps1 b/libexec/presets.ps1 index cb923c1..7952012 100644 --- a/libexec/presets.ps1 +++ b/libexec/presets.ps1 @@ -4,5 +4,5 @@ "Available presets:" gci "$psscriptroot\..\presets" | % { - " $([io.path]::getfilenamewithoutextension($_.name))" + " $([io.path]::getfilenamewithoutextension($_.name))" } \ No newline at end of file diff --git a/presets/big.json b/presets/big.json index c072d9c..c113f3f 100644 --- a/presets/big.json +++ b/presets/big.json @@ -1,4 +1,4 @@ { - "window_size": "120x38", - "screen_buffer_size": "120x300" + "window_size": "120x38", + "screen_buffer_size": "120x300" } \ No newline at end of file diff --git a/presets/defaults.json b/presets/defaults.json index 383a191..e4f932c 100644 Binary files a/presets/defaults.json and b/presets/defaults.json differ diff --git a/presets/medium.json b/presets/medium.json index 9a25c90..a6c4c34 100644 --- a/presets/medium.json +++ b/presets/medium.json @@ -1,4 +1,4 @@ { - "window_size": "100x32", - "screen_buffer_size": "100x300" + "window_size": "100x32", + "screen_buffer_size": "100x300" } \ No newline at end of file diff --git a/presets/powershell-defaults.json b/presets/powershell-defaults.json index 473a8c0..3169a93 100644 --- a/presets/powershell-defaults.json +++ b/presets/powershell-defaults.json @@ -1,5 +1,5 @@ { - "_comment": " + "_comment": " Notes ===== @@ -11,43 +11,43 @@ This the same as the console defaults, except: It's also a really big window, since you need 50% more space when you're typing PowerShell Verb-Noun commands, if not more. - ", - "black": "#000000", - "dark_blue": "#000080", - "dark_green": "#008000", - "dark_cyan": "#008080", - "dark_red": "#800000", - "dark_magenta": "#012456", - "dark_yellow": "#eeedf0", - "gray": "#c0c0c0", - "dark_gray": "#808080", - "blue": "#0000ff", - "green": "#00ff00", - "cyan": "#00ffff", - "red": "#ff0000", - "magenta": "#ff00ff", - "yellow": "#ffff00", - "white": "#ffffff", - - "screen_colors": "dark_yellow,dark_magenta", - "popup_colors": "cyan,white", - - "font_face": "", - "font_true_type": false, - "font_size": "8x12", - "font_weight": 0, - - "cursor_size": "small", - - "window_size": "120x50", - "screen_buffer_size": "120x3000", - - "command_history_length": 50, - "num_history_buffers": 4, - - "quick_edit": true, - "insert_mode": true, - "fullscreen": false, - - "load_console_IME": true + ", + "black": "#000000", + "dark_blue": "#000080", + "dark_green": "#008000", + "dark_cyan": "#008080", + "dark_red": "#800000", + "dark_magenta": "#012456", + "dark_yellow": "#eeedf0", + "gray": "#c0c0c0", + "dark_gray": "#808080", + "blue": "#0000ff", + "green": "#00ff00", + "cyan": "#00ffff", + "red": "#ff0000", + "magenta": "#ff00ff", + "yellow": "#ffff00", + "white": "#ffffff", + + "screen_colors": "dark_yellow,dark_magenta", + "popup_colors": "cyan,white", + + "font_face": "", + "font_true_type": false, + "font_size": "8x12", + "font_weight": 0, + + "cursor_size": "small", + + "window_size": "120x50", + "screen_buffer_size": "120x3000", + + "command_history_length": 50, + "num_history_buffers": 4, + + "quick_edit": true, + "insert_mode": true, + "fullscreen": false, + + "load_console_IME": true } \ No newline at end of file diff --git a/presets/small.json b/presets/small.json index 3105dc9..5ba2002 100644 --- a/presets/small.json +++ b/presets/small.json @@ -1,4 +1,4 @@ { - "window_size": "80x25", - "screen_buffer_size": "80x300" + "window_size": "80x25", + "screen_buffer_size": "80x300" } \ No newline at end of file diff --git a/presets/solarized-light.json b/presets/solarized-light.json index ea18f37..fc22bd9 100644 --- a/presets/solarized-light.json +++ b/presets/solarized-light.json @@ -1,40 +1,40 @@ { - "black": "#002b36", - "dark_blue": "#268bd2", - "dark_green": "#859900", - "dark_aqua": "#2aa198", - "dark_red": "#dc322f", - "dark_magenta": "#d33682", - "dark_yellow": "#b58900", - "gray": "#eee8d5", - "dark_gray": "#073642", - "blue": "#839496", - "green": "#586e75", - "cyan": "#93a1a1", - "red": "#cb4b16", - "magenta": "#6c71c4", - "yellow": "#657b83", - "white": "#fdf6e3", + "black": "#002b36", + "dark_blue": "#268bd2", + "dark_green": "#859900", + "dark_aqua": "#2aa198", + "dark_red": "#dc322f", + "dark_magenta": "#d33682", + "dark_yellow": "#b58900", + "gray": "#eee8d5", + "dark_gray": "#073642", + "blue": "#839496", + "green": "#586e75", + "cyan": "#93a1a1", + "red": "#cb4b16", + "magenta": "#6c71c4", + "yellow": "#657b83", + "white": "#fdf6e3", - "screen_colors": "yellow,white", - "popup_colors": "blue,black", + "screen_colors": "yellow,white", + "popup_colors": "blue,black", - "font_face": "Consolas", - "font_true_type": true, - "font_size": "0x20", - "font_weight": 700, + "font_face": "Consolas", + "font_true_type": true, + "font_size": "0x20", + "font_weight": 700, - "cursor_size": "small", + "cursor_size": "small", - "window_size": "80x25", - "screen_buffer_size": "80x3000", + "window_size": "80x25", + "screen_buffer_size": "80x3000", - "command_history_length": 200, - "num_history_buffers": 4, + "command_history_length": 200, + "num_history_buffers": 4, - "quick_edit": true, - "insert_mode": true, - "fullscreen": false, + "quick_edit": true, + "insert_mode": true, + "fullscreen": false, - "load_console_IME": true + "load_console_IME": true } diff --git a/presets/solarized.json b/presets/solarized.json index 86dcfae..d1dabd9 100644 --- a/presets/solarized.json +++ b/presets/solarized.json @@ -1,40 +1,40 @@ { - "black": "#002b36", - "dark_blue": "#268bd2", - "dark_green": "#859900", - "dark_aqua": "#2aa198", - "dark_red": "#dc322f", - "dark_magenta": "#d33682", - "dark_yellow": "#b58900", - "gray": "#eee8d5", - "dark_gray": "#073642", - "blue": "#839496", - "green": "#586e75", - "cyan": "#93a1a1", - "red": "#cb4b16", - "magenta": "#6c71c4", - "yellow": "#657b83", - "white": "#fdf6e3", + "black": "#002b36", + "dark_blue": "#268bd2", + "dark_green": "#859900", + "dark_aqua": "#2aa198", + "dark_red": "#dc322f", + "dark_magenta": "#d33682", + "dark_yellow": "#b58900", + "gray": "#eee8d5", + "dark_gray": "#073642", + "blue": "#839496", + "green": "#586e75", + "cyan": "#93a1a1", + "red": "#cb4b16", + "magenta": "#6c71c4", + "yellow": "#657b83", + "white": "#fdf6e3", - "screen_colors": "blue,black", - "popup_colors": "yellow,white", - - "font_face": "Consolas", - "font_true_type": true, - "font_size": "0x20", - "font_weight": 700, + "screen_colors": "blue,black", + "popup_colors": "yellow,white", + + "font_face": "Consolas", + "font_true_type": true, + "font_size": "0x20", + "font_weight": 700, - "cursor_size": "small", + "cursor_size": "small", - "window_size": "80x25", - "screen_buffer_size": "80x3000", + "window_size": "80x25", + "screen_buffer_size": "80x3000", - "command_history_length": 200, - "num_history_buffers": 4, + "command_history_length": 200, + "num_history_buffers": 4, - "quick_edit": true, - "insert_mode": true, - "fullscreen": false, + "quick_edit": true, + "insert_mode": true, + "fullscreen": false, - "load_console_IME": true + "load_console_IME": true } diff --git a/test/shortcuts.ps1 b/test/shortcuts.ps1 new file mode 100644 index 0000000..ab4b218 --- /dev/null +++ b/test/shortcuts.ps1 @@ -0,0 +1,7 @@ +. "$psscriptroot\..\lib\shortcut.ps1" + +$p = '~\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\powershell.lnk' + +linksto $p "$pshome\powershell.exe" +!(linksto "asdf" "$pshome\powershell.exe") # file not found +!(linksto "C:\windows\notepad.exe", "$pshome\powershell.exe") # not a shortcut \ No newline at end of file