16
16
from click .exceptions import FileError
17
17
18
18
from libtmux .common import (
19
- has_gte_version ,
20
- has_minimum_version ,
21
- which ,
19
+ has_gte_version ,
20
+ has_minimum_version ,
21
+ which ,
22
22
get_version ,
23
- tmux_cmd
23
+ tmux_cmd ,
24
24
)
25
25
from libtmux .exc import TmuxCommandNotFound
26
26
from libtmux .server import Server
@@ -855,9 +855,7 @@ def command_freeze(session_name, socket_name, socket_path, force):
855
855
@click .argument ('config' , type = ConfigPath (exists = True ), nargs = - 1 )
856
856
@click .option ('-S' , 'socket_path' , help = 'pass-through for tmux -S' )
857
857
@click .option ('-L' , 'socket_name' , help = 'pass-through for tmux -L' )
858
- @click .option (
859
- '-s' , 'new_session_name' , help = 'start new session with new session name'
860
- )
858
+ @click .option ('-s' , 'new_session_name' , help = 'start new session with new session name' )
861
859
@click .option ('--yes' , '-y' , 'answer_yes' , help = 'yes' , is_flag = True )
862
860
@click .option (
863
861
'-d' , 'detached' , help = 'Load the session without attaching it' , is_flag = True
@@ -883,7 +881,7 @@ def command_load(
883
881
new_session_name ,
884
882
answer_yes ,
885
883
detached ,
886
- colors
884
+ colors ,
887
885
):
888
886
"""Load a tmux workspace from each CONFIG.
889
887
@@ -1075,10 +1073,7 @@ def prepend_tab(strings):
1075
1073
"""
1076
1074
Prepend tab to strings in list.
1077
1075
"""
1078
- return list (map (
1079
- lambda x : '\t %s' % x ,
1080
- strings
1081
- ))
1076
+ return list (map (lambda x : '\t %s' % x , strings ))
1082
1077
1083
1078
def output_break ():
1084
1079
"""
@@ -1090,22 +1085,26 @@ def format_tmux_resp(std_resp):
1090
1085
"""
1091
1086
Format tmux command response for tmuxp stdout.
1092
1087
"""
1093
- return '\n ' .join ([
1094
- * prepend_tab (std_resp .stdout ),
1095
- click .style (
1096
- '\n ' .join (prepend_tab (std_resp .stderr )),
1097
- fg = 'red'
1098
- )
1099
- ])
1088
+ return '\n ' .join (
1089
+ [
1090
+ * prepend_tab (std_resp .stdout ),
1091
+ click .style ('\n ' .join (prepend_tab (std_resp .stderr )), fg = 'red' ),
1092
+ ]
1093
+ )
1100
1094
1101
1095
output = [
1102
1096
output_break (),
1103
- 'environment:\n %s' % '\n ' .join (prepend_tab ([
1104
- 'system: %s' % os .uname ().sysname ,
1105
- 'arch: %s' % os .uname ().machine ,
1106
- 'os: {0} {1}' .format (os .uname ().nodename , os .uname ().version ),
1107
- 'kernel: %s' % os .uname ().release ,
1108
- ])),
1097
+ 'environment:\n %s'
1098
+ % '\n ' .join (
1099
+ prepend_tab (
1100
+ [
1101
+ 'system: %s' % os .uname ().sysname ,
1102
+ 'arch: %s' % os .uname ().machine ,
1103
+ 'os: {0} {1}' .format (os .uname ().nodename , os .uname ().version ),
1104
+ 'kernel: %s' % os .uname ().release ,
1105
+ ]
1106
+ )
1107
+ ),
1109
1108
output_break (),
1110
1109
'python version: %s' % ' ' .join (sys .version .split ('\n ' )),
1111
1110
'system PATH: %s' % os .environ ['PATH' ],
@@ -1116,21 +1115,12 @@ def format_tmux_resp(std_resp):
1116
1115
'tmuxp path: %s' % tmuxp_path ,
1117
1116
'shell: %s' % os .environ ['SHELL' ],
1118
1117
output_break (),
1119
- 'tmux sessions:\n %s' % format_tmux_resp (
1120
- tmux_cmd ('list-sessions' )
1121
- ),
1122
- 'tmux windows:\n %s' % format_tmux_resp (
1123
- tmux_cmd ('list-windows' )
1124
- ),
1125
- 'tmux panes:\n %s' % format_tmux_resp (
1126
- tmux_cmd ('list-panes' )
1127
- ),
1128
- 'tmux global options:\n %s' % format_tmux_resp (
1129
- tmux_cmd ('show-options' , '-g' )
1130
- ),
1131
- 'tmux window options:\n %s' % format_tmux_resp (
1132
- tmux_cmd ('show-window-options' , '-g' )
1133
- )
1118
+ 'tmux sessions:\n %s' % format_tmux_resp (tmux_cmd ('list-sessions' )),
1119
+ 'tmux windows:\n %s' % format_tmux_resp (tmux_cmd ('list-windows' )),
1120
+ 'tmux panes:\n %s' % format_tmux_resp (tmux_cmd ('list-panes' )),
1121
+ 'tmux global options:\n %s' % format_tmux_resp (tmux_cmd ('show-options' , '-g' )),
1122
+ 'tmux window options:\n %s'
1123
+ % format_tmux_resp (tmux_cmd ('show-window-options' , '-g' )),
1134
1124
]
1135
1125
1136
1126
click .echo ('\n ' .join (output ))
0 commit comments