터미널을 열고 9개의 터미널로 분할하고 하나의 스크립트를 사용하여 터미널 간에 전환하는 방법은 무엇입니까?

터미널을 열고 9개의 터미널로 분할하고 하나의 스크립트를 사용하여 터미널 간에 전환하는 방법은 무엇입니까?

터미널을 열고 9개 부분(3x3)으로 분할하고 bash 스크립트를 실행하고 싶습니다. 그러나 터미널 부분마다 스크립트가 다릅니다.

Perl, Python 또는 Bash를 사용하여 이 작업을 수행할 수 있습니까?

키보드 단축키를 사용하지 않고 어떻게 작은 터미널 사이를 전환할 수 있습니까?

아, 그런데 저는 terminator. 그리고 그러한 기능을 가능하게 하는 다른 터미널 에뮬레이터가 있다면 그것은 무엇입니까?

답변1

나 자신을 표절하다, 원하는 설정으로 프로필을 설정할 수 있습니다(지침은 다음에서 수정됨).여기):

  1. terminator원하는 레이아웃을 실행 하고 설정하세요. Ctrl+ Shift+를 사용 E하여 창을 수직으로 분할하고 Ctrl+ Shift+ O(0이 아닌 O)를 사용하여 수평으로 분할할 수 있습니다. 이 예에서는 6개의 창으로 구성된 레이아웃을 만들었습니다.

    여기에 이미지 설명을 입력하세요

  2. 창을 마우스 오른쪽 버튼으로 클릭 terminator하고 선택하십시오.환경설정. 일단환경설정창문 열려있어, 가봐레이아웃그리고 클릭추가하다:

    여기에 이미지 설명을 입력하세요

  3. 그러면레이아웃새 레이아웃으로 목록을 작성하세요.

    여기에 이미지 설명을 입력하세요

  4. 레이아웃에서 생성한 각 터미널을 찾아 클릭합니다. 그런 다음 오른쪽에 시작 시 실행할 명령을 입력합니다.

    여기에 이미지 설명을 입력하세요

    중요한:명령 뒤에는 ; bash. 그렇게 하지 않으면 터미널에서 사용자가 제공한 명령을 실행하고 종료하므로 터미널에 액세스할 수 없습니다. 터미널을 사용하려면 각 명령 후에 셸을 시작해야 합니다.

    모든 명령을 설정한 후 다음을 클릭합니다.닫다그런 다음 종료하십시오 terminator.

  5. terminator구성 파일을 열고 ~/.config/terminator/config기본 구성에 대한 레이아웃 아래 섹션을 삭제합니다. 그런 다음 생성한 레이아웃의 이름을 기본값으로 변경합니다. 다음과 같아야 합니다.

     [global_config]
     [keybindings]
     [profiles]
       [[default]]
     [layouts]
       [[default]]
         [[[child0]]]
           position = 446:100
           type = Window
           order = 0
           parent = ""
           size = 885, 550
         [[[child1]]]
           position = 444
           type = HPaned
           order = 0
           parent = child0
         [[[child2]]]
           position = 275
           type = VPaned
           order = 0
           parent = child1
         [[[child5]]]
           position = 219
           type = HPaned
           order = 1
           parent = child1
         [[[child6]]]
           position = 275
           type = VPaned
           order = 0
           parent = child5
         [[[child9]]]
           position = 275
           type = VPaned
           order = 1
           parent = child5
         [[[terminal11]]]
           profile = default
           command = 'df -h; bash'
           type = Terminal
           order = 1
           parent = child9
         [[[terminal10]]]
           profile = default
           command = 'export foo="bar" && cd /var/www/; bash'
           type = Terminal
           order = 0
           parent = child9
         [[[terminal3]]]
           profile = default
           command = 'ssh -Yp 24222 [email protected]'
           type = Terminal
           order = 0
           parent = child2
         [[[terminal4]]]
           profile = default
           command = 'top; bash'
           type = Terminal
           order = 1
           parent = child2
         [[[terminal7]]]
           profile = default
           command = 'cd /etc; bash'
           type = Terminal
           order = 0
           parent = child6
         [[[terminal8]]]
           profile = default
           command = 'cd ~/dev; bash'
           type = Terminal
           order = 1
           parent = child6
     [plugins]
    

최종 결과는 실행 시 terminator6개의 창으로 열리며, 각 창은 사용자가 지정한 명령을 실행했거나 실행 중입니다.

여기에 이미지 설명을 입력하세요

또한 원하는 만큼 다양한 프로필을 설정할 수 있으며 -p프로필 이름을 제공하는 스위치를 사용하여 터미네이터를 실행하거나 실행 후 원하는 프로필로 수동으로 전환할 수 있습니다.

답변2

터미널 멀티플렉서 tmux를 검색하고 있습니까?

https://github.com/tmux/tmux

답변3

내가 이것을 사용했을 때 terminator여러 터미널을 열고 응용 프로그램을 실행하는 데 사용했던 rc 파일입니다. 에 저장하세요 .config/terminator/config.

[global_config]
  title_hide_sizetext = True
  enabled_plugins = LaunchpadCodeURLHandler, APTURLHandler, LaunchpadBugURLHandler
[keybindings]
[profiles]
  [[default]]
    font = DejaVu Sans Mono 9
    cursor_blink = False
    scrollback_infinite = True
[layouts]
  [[default]]

    [[[root]]]
      position = -4:0
      type = Window
      order = 0 
      parent = ""
      size = 1072, 1884

    [[[grand]]]
      position = 536 
      type = HPaned
      order = 0 
      parent = root
    [[[left]]]
      position = 942 
      type = VPaned
      order = 0 
      parent = grand
    [[[right]]]
      position = 942 
      type = VPaned
      order = 1 
      parent = grand



    [[[terminal1]]]
      profile = default
      type = Terminal
      order = 0 
      parent = left
      command = "cd ~/code/foo; bash"
    [[[terminal2]]]
      profile = default
      type = Terminal
      order = 1 
      parent = left
      command = "cd ~/bar/baz; bash"



    [[[terminal3]]]
      profile = default
      type = Terminal
      order = 1 
      parent = right
      command = ""
    [[[terminal4]]]
      profile = default
      type = Terminal
      order = 0 
      parent = right
      command = "cmus; bash"



[plugins]

편집하다:이 정보는 아마도 훨씬 이전 스레드에 있는 Terdon의 게시물에서 나온 것일 수 있습니다. 나는 이 설정을 몇 달 동안 사용해 왔지만 여기에 있는 Terdon의 게시물은 매우 친숙해 보입니다!

답변4

터미네이터 터미널 에뮬레이터 분할을 위한 래퍼 스크립트 https://github.com/AlekseyChudov/terminator-split

관련 정보