Create TOC

2016년 7월 11일

Vim/Win32에서 CtrlSF 가 동작하지 않을때

Windows환경의 Vim x64에서 CtrlSF 플러그인이 동작하지 않으면 아래와 같이 shellescape을 적당히 바꾸어 준다.

--- a/autoload/ctrlsf/backend.vim
+++ b/autoload/ctrlsf/backend.vim
@@ -110,7 +110,11 @@ func! s:BuildCommand(args) abort
     endif
 
     " pattern (including escape)
-    call add(tokens, shellescape(ctrlsf#opt#GetOpt('pattern')))
+    if has('win32')
+  call add(tokens, '"' . ctrlsf#opt#GetOpt('pattern') . '"')
+ else
+  call add(tokens, shellescape(ctrlsf#opt#GetOpt('pattern')))
+ endif
 
     " path
     call extend(tokens, ctrlsf#opt#GetPath())
--- a/autoload/ctrlsf/opt.vim
+++ b/autoload/ctrlsf/opt.vim
@@ -139,7 +139,11 @@ func! ctrlsf#opt#GetPath() abort
             let resolved_path = expand(path, 0, 1)
 
             for r_path in resolved_path
-                call add(path_tokens, shellescape(r_path))
+    if has('win32')
+     call add(path_tokens, '"' . r_path . '"')
+    else
+     call add(path_tokens, shellescape(r_path))
+    endif
             endfo
         endfo
     else
@@ -151,7 +155,11 @@ func! ctrlsf#opt#GetPath() abort
         if empty(path)
             let path = expand('%:p')
         endif
-        call add(path_tokens, shellescape(path))
+  if has('win32')
+   call add(path_tokens, '"' . path . '"')
+  else
+   call add(path_tokens, shellescape(path))
+  endif
     endif
 
     return path_tokens

raspberrypi-ui-mods 설치 후 pkexec 문제

raspberrypi-ui-mods 설치 후 pkexec에서 추가한 계정이 표시되지 않는다. sudo 관련 정책파일을 추가해서 발생하는 문제다. 아래처럼 정책 파일을 추가해주면 된다.
$ cd /etc/polkit-1/localauthority.conf.d
$ sudo cp 51-desktop-sudo.con 61-desktop-policy-fix.conf