ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Windows Terminal
    Development Environment 2019. 8. 1. 00:30

    WIndows 10 빌드 1903 에서 새로이 Windows Terminal(Preview) 가 사용이 가능하다.

     

    CMD / PowerShell 의 사용에 불편함이 크다면 고민없이 설치해 보자

     

    <Microsoft Store> 에서 Windows Terminal 로 검색 설치, 실행!

    설치가 끝났다면 우선 Windows Terminal의 setting 부터 손을 보자. Preview version 이여서인지 모르겠지만 GUI 환경의 setting이 아닌 profiles.json 형태로 Open 이 된다. 

     

    < Ctrl + , > 또는 아래 메뉴에서 Settings를 선택

    json 파일에 대한 기본앱 설정이 되어있지 않다면 Windows에서 실행할 앱 팝업이 뜰 것이고 적당한 editor를 선택하자

    기본앱 초기화는 설정 > 기본 앱 > 파일 형식별 기본 앱 선택 에서 json 항목 선택하여 가능하다

     

    <profiles.json>

    각 옵션별로 확인해 보면

     

    - globals

    Terminal columns/ Rows, Tap 설정, key-map에 관한 옵션이 있다.

     -- initialCols : Windows terminal 실행 시 terminal의 column 수 (default 120)

     -- initialRows : Windows terminal 실행 시 terminal의 row 수 (default 30) 

     -- keybindings :  키 맵

      * ctrl + w : Close Tab

      * ctrl + t : New Tab

      * ctrl + shift + [1...8] : New Tab Profile[1...8], Profile 은 뒤의 <profiles> 항목에 정의 되어지고 메뉴를 통해 확인 가능하다

     

      * ctrl + tab : Next Tab (열려있는 탭의 이동)
      * ctrl + shift + tab : Previous Tab

      * ctrl + shift + down : Scroll Down

      * ctrl + shift + pgdn : Scroll Down Page

      * ctrl + shift + up : Scroll Up

      * ctrl + shift + pgup : Scroll Up Page

      * alt + [1..9] : Switch to Tab[1...9]

     -- requestedTheme : (default system)

     -- showTabsInTitlebar : TitleBar 안에 Tabs을 같이 보여 줌 (default true)

        <false>

     -- showTerminalTitleInTitlebar : TitleBar 안에 Tab의 title을 보여준다 (default true)

        <false>

     

    - profiles

      Terminal의 profiles 에 대한 설명으로 WSL 설치 후 Windows terminal을 설치시 아래 처럼 3개의 profiles 생성 된다.

      * Windows PowerShell (powershell.exe)
      * cmd (cmd.exe)

      * Ubuntu (wsl.exe -d Ubuntu)

        ** ssh 로 remote pc 접속이 많다고 하면, open ssh 실행하는 profile을 새로 추가하는 것도 좋은 방법이다

        아래 처럼 새로운 프로파일을 추가해 보자

         * acrylicOpacity : 두명도
         * useAcrylic : 투명하게 사용

         * GUID로 profiles 가 구분이 되나 새로 추가된 profile인 경우 GUID를 삭제하자, Windwos Terminal을 재시작 하면         새로운 GUID 값으로 추가 된 것을 볼 수 있다

        "profiles" : 
        [
            {
                "acrylicOpacity" : 0.5,
                "closeOnExit" : true,
                "colorScheme" : "Chalk",
                "commandline" : "powershell -C ssh ykno2@192.168.21.245",
                "cursorColor" : "#FFFFFF",
                "cursorShape" : "bar",
                "fontFace" : "D2Coding",
                "fontSize" : 12,
                "historySize" : 9001,
                "icon" : "ms-appx:///ProfileIcons/{61c54bbd-c2c6-5271-96e7-009a87ff44bf}.png",
                "name" : "ssh@mandarin",
                "padding" : "0, 0, 0, 0",
                "snapOnInput" : true,
                "startingDirectory" : "d:\\",
                "useAcrylic" : true
            },

     

     

      각각의 profile 별 수정해 볼만한게 아래 정도 있는 것 같다.

      * background : 배경색

      * colorScheme : 스킴은 <schemes> 에서 선택이 가능하다

      * fontFace : 폰트

      * fontSize : 크기

      * startingDirectory : 시작 디렉토리

      

    - schemes

      profile에서 선택한 schemes에 대한 정의 이며 기본으로 다섯가지가 제공된다.

      * Campbell

      * One Half Dark

      * One Half Light

      * Solarized Dark

      * Solarized Light

    더 많은 color scheme 을 바꾸고 싶으면 Open source project를 통해 바꿔보자

     

    https://github.com/mbadolato/iTerm2-Color-Schemes

     

    친천하게도 200개의 Screenshot들과 Windows terminal용 json 코드 값도 포함되어져 있다.

    먼저 github에서 프로젝트 파일을 git 으로 clone 하거나 zip 으로 다운로드 후 적당한 위치에 풀자

     

    우선 스크린샷에서 맘에 드는 컬러스킴을 선택

     

     

    예시로 chalk.png로 바꿔 보기로 하자

    chalk.png

    project file의 windiTerm2-Color-Schemes-master\windowsterminal\Chalk.json 파일의 내용을 복사 후 

    {
      "name": "Chalk",
      "black": "#7d8b8f",
      "red": "#b23a52",
      "green": "#789b6a",
      "yellow": "#b9ac4a",
      "blue": "#2a7fac",
      "purple": "#bd4f5a",
      "cyan": "#44a799",
      "white": "#d2d8d9",
      "brightBlack": "#888888",
      "brightRed": "#f24840",
      "brightGreen": "#80c470",
      "brightYellow": "#ffeb62",
      "brightBlue": "#4196ff",
      "brightPurple": "#fc5275",
      "brightCyan": "#53cdbd",
      "brightWhite": "#d2d8d9",
      "background": "#2b2d2e",
      "foreground": "#d2d8d9"
    }

    Windows Terminal settings의 profiles.json 의 scheme 안에 추가해 주자

    변경 후 실행하면

    업데이트 된 것을 볼 수 있다.

Designed by Tistory.