to write input to the PTY. 2015/11/13 06:26:33 Server is starting with command: tmux new -A -s gotty 2015/11/13 06:26:33 URL: http://127.0.0.1:8080/ 2015/11/13 06:26:33 URL: http://[::1]:8080/ 2015/11/13 06:26:33 URL: http://[fe80::a27e:a3b8:cfa7:22a6]:8080/ 2015/11/13 06:26:33 URL: http://192.168.2.217:8080/ 2015/11/13 06:26:33 URL: http://[fe80::85e0:9218:1854:8531]:8080/ この状態で URL: 〜 にブラウザでアクセスすると top コマンドが実行されるのが 確認できる
$ gotty -w bash しかし複数のブラウザでアクセスするとそれぞれ別のセッションになってしま う.みんなでひとつの端末を叩きたい…… 2015/08/23 14:47:42 Server is starting with command: bash 2015/08/23 14:47:46 New client connected: 127.0.0.1:36194 2015/08/23 14:47:46 Command is running for client 127.0.0.1:36194 with PID 28469 2015/08/23 14:48:56 New client connected: 127.0.0.1:36208 2015/08/23 14:48:56 Command is running for client 127.0.0.1:36208 with PID 29315
starts a new process when a new client connects to the server. This means users cannot share a single terminal with others by default. However, you can use terminal multiplexers for sharing a single process with multiple clients. For example, you can start a new tmux session named gotty with top command by the command below. $ gotty tmux new -A -s gotty top This command doesn't allow clients to send keystrokes, however, you can attach the session from your local terminal and run operations like switching the mode of the top command. To connect to the tmux session from your terminal, you can use following command. $ tmux new -A -s gotty By using terminal multiplexers, you can have the control of your terminal and allow clients to just see your screen.