Eclectic Media Git run_in_split / 011c909
Created a small option, runs in small pane Ariana Giroux 9 months ago
1 changed file(s) with 6 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
1313 @option('--pause-on-error', is_flag=True,
1414 help='If true, pause until user presses enter only if the process does '
1515 'not exit 0.')
16 @option('--small', is_flag=True,
17 help='Creates pane at 15% of total screen space')
1618 def run_in_pane(command, **kwargs):
1719 if not list(environ).count('TMUX'):
1820 raise RuntimeError('CRITICAL! Must be run within TMUX!')
2224 if list(kwargs).count('horizontal'):
2325 if kwargs['horizontal']:
2426 executable += ' -h'
27
28 if kwargs['small']:
29 executable += ' -p 15'
2530
2631 executable += " '{}".format(command)
2732 # current command (if "echo hello world"):
5762 executable += "'" # close command quote
5863 system(executable)
5964
65
6066 try:
6167 run_in_pane()
6268 except Exception as e: