From 8f24fd2ca8c7044ea568cd254ea03695c87219c1 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Sun, 25 Oct 2020 13:52:39 -0700 Subject: [PATCH 01/16] Adding debug-info command --- tmuxp/cli.py | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 63 insertions(+), 2 deletions(-) diff --git a/tmuxp/cli.py b/tmuxp/cli.py index 6b1ac0cf5d..cb7053d88e 100644 --- a/tmuxp/cli.py +++ b/tmuxp/cli.py @@ -15,11 +15,19 @@ import kaptan from click.exceptions import FileError -from libtmux.common import has_gte_version, has_minimum_version, which +from libtmux.common import ( + has_gte_version, + has_minimum_version, + which, + get_version, + tmux_cmd, + which +) from libtmux.exc import TmuxCommandNotFound from libtmux.server import Server +from libtmux import __version__ as libtmux_version -from . import config, exc, log, util +from . import config, exc, log, util, __file__ as tmuxp_path from .__about__ import __version__ from ._compat import PY3, PYMINOR, string_types from .workspacebuilder import WorkspaceBuilder, freeze @@ -1054,3 +1062,56 @@ def command_ls(): if os.path.isdir(f) or ext not in VALID_CONFIG_DIR_FILE_EXTENSIONS: continue print(stem) + + +@cli.command(name='debug-info', short_help='Print out all diagnostic info') +def command_debug_info(): + """ + """ + + def prepend_tab(strings): + """ + """ + return list(map( + lambda x: '\t%s' % x, + strings + )) + + def format_tmux_resp(std_resp): + """ + """ + return '\n'.join([ + *prepend_tab(std_resp.stdout), + click.style( + '\n'.join(prepend_tab(std_resp.stderr)), + fg='red' + ) + ]) + + output = [ + 'python version: %s' % ' '.join(sys.version.split('\n')), + 'system PATH: %s' % os.environ['PATH'], + 'tmux version: %s' % get_version(), + 'libtmux version: %s' % libtmux_version, + 'tmuxp version: %s' % __version__, + 'tmux path: %s' % which('tmux'), + 'tmuxp path: %s' % tmuxp_path, + 'shell: %s' % os.environ['SHELL'], + 'tmux sessions:\n%s' % format_tmux_resp( + tmux_cmd('list-sessions') + ), + 'tmux windows:\n%s' % format_tmux_resp( + tmux_cmd('list-windows') + ), + 'tmux panes:\n%s' % format_tmux_resp( + tmux_cmd('list-panes') + ), + 'tmux global options:\n%s' % format_tmux_resp( + tmux_cmd('show-options', '-g') + ), + 'tmux window options:\n%s' % format_tmux_resp( + tmux_cmd('show-window-options', '-g') + ) + ] + + click.echo('\n'.join(output)) From 324b537fe32e231e9475ed50eb27b601951fed48 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Sun, 25 Oct 2020 14:23:17 -0700 Subject: [PATCH 02/16] adding system info to debug-info and updating issues_template --- .github/issue_template.md | 19 +++---------------- tmuxp/cli.py | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/.github/issue_template.md b/.github/issue_template.md index 5368bd0a61..ef99c9b8c0 100644 --- a/.github/issue_template.md +++ b/.github/issue_template.md @@ -2,23 +2,10 @@ * For general technical questions, problems or feature requests related to the code **in this repository** file an issue. ### Step 2: Provide tmuxp details - * Python version - * system PATH - * tmux version - * tmuxp version - * tmux path - * tmuxp path, - * libtmux version - * shell - * output of `tmux list-sessions`, `tmux list-windows`, `tmux list-panes` - * output of `tmux show-options -g`, `tmux show-window-options -g` - * output of `tmuxp freeze ` + * Include output of `tmuxp debug-info` + * Include any other pertinant system info not captured -### Step 3: Describe your environment - * Architecture: _____ - * OS version: _____ - -### Step 4: Describe the problem: +### Step 3: Describe the problem: #### Steps to reproduce: 1. _____ 2. _____ diff --git a/tmuxp/cli.py b/tmuxp/cli.py index cb7053d88e..ce2a7a3fa5 100644 --- a/tmuxp/cli.py +++ b/tmuxp/cli.py @@ -1067,18 +1067,27 @@ def command_ls(): @cli.command(name='debug-info', short_help='Print out all diagnostic info') def command_debug_info(): """ + Print debug info to submit with Issues. """ def prepend_tab(strings): """ + Prepend tab to strings in list. """ return list(map( lambda x: '\t%s' % x, strings )) + def generate_output_break(): + """ + Generate output break. + """ + return '-' * 25 + def format_tmux_resp(std_resp): """ + Format tmux command response for tmuxp stdout. """ return '\n'.join([ *prepend_tab(std_resp.stdout), @@ -1089,6 +1098,14 @@ def format_tmux_resp(std_resp): ]) output = [ + generate_output_break(), + 'environment:\n%s' % '\n'.join(prepend_tab([ + 'system: %s' % os.uname().sysname, + 'arch: %s' % os.uname().machine, + 'os: {0} {1}'.format(os.uname().nodename, os.uname().version), + 'kernel: %s' % os.uname().release, + ])), + generate_output_break(), 'python version: %s' % ' '.join(sys.version.split('\n')), 'system PATH: %s' % os.environ['PATH'], 'tmux version: %s' % get_version(), @@ -1097,6 +1114,7 @@ def format_tmux_resp(std_resp): 'tmux path: %s' % which('tmux'), 'tmuxp path: %s' % tmuxp_path, 'shell: %s' % os.environ['SHELL'], + generate_output_break(), 'tmux sessions:\n%s' % format_tmux_resp( tmux_cmd('list-sessions') ), From 926899c8d3638c324d0b16ff3a449eca32863b5d Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Sun, 25 Oct 2020 14:34:35 -0700 Subject: [PATCH 03/16] adding test for debug-info command --- tests/test_cli.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/test_cli.py b/tests/test_cli.py index 2741a30a2f..ca30bda96c 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -16,6 +16,7 @@ from tmuxp import cli, config, exc from tmuxp.cli import ( command_ls, + command_debug_info, get_config_dir, is_pure_name, load_workspace, @@ -953,3 +954,22 @@ def test_ls_cli(monkeypatch, tmpdir): runner = CliRunner() cli_output = runner.invoke(command_ls).output assert cli_output == '\n'.join(stems) + '\n' + + +def test_debug_info_cli(): + runner = CliRunner() + cli_output = runner.invoke(command_debug_info).output + assert 'environment' in cli_output + assert 'python version' in cli_output + assert 'system PATH' in cli_output + assert 'tmux version' in cli_output + assert 'libtmux version' in cli_output + assert 'tmuxp version' in cli_output + assert 'tmux path' in cli_output + assert 'tmuxp path' in cli_output + assert 'shell' in cli_output + assert 'tmux session' in cli_output + assert 'tmux windows' in cli_output + assert 'tmux panes' in cli_output + assert 'tmux global options' in cli_output + assert 'tmux window options' in cli_output \ No newline at end of file From 4e64e502c1c3f139da784d8c6b000e581d6f8b54 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Sat, 31 Oct 2020 11:24:27 -0700 Subject: [PATCH 04/16] working on the logfile addition --- tmuxp/cli.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tmuxp/cli.py b/tmuxp/cli.py index ce2a7a3fa5..249b3581fa 100644 --- a/tmuxp/cli.py +++ b/tmuxp/cli.py @@ -874,6 +874,7 @@ def command_freeze(session_name, socket_name, socket_path, force): flag_value=88, help='Like -2, but indicates that the terminal supports 88 colours.', ) +@click.option('--log-file', 'log_file', help='File to log output to') def command_load( ctx, config, From 29349bb4dde2dba127e5783e247a7987a6700b10 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Sat, 31 Oct 2020 15:25:55 -0700 Subject: [PATCH 05/16] working on logging (saving work while switching branch) --- tmuxp/cli.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tmuxp/cli.py b/tmuxp/cli.py index 249b3581fa..5bbf5869f2 100644 --- a/tmuxp/cli.py +++ b/tmuxp/cli.py @@ -856,7 +856,9 @@ def command_freeze(session_name, socket_name, socket_path, force): @click.argument('config', type=ConfigPath(exists=True), nargs=-1) @click.option('-S', 'socket_path', help='pass-through for tmux -S') @click.option('-L', 'socket_name', help='pass-through for tmux -L') -@click.option('-s', 'new_session_name', help='start new session with new session name') +@click.option( + '-s', 'new_session_name', help='start new session with new session name' +) @click.option('--yes', '-y', 'answer_yes', help='yes', is_flag=True) @click.option( '-d', 'detached', help='Load the session without attaching it', is_flag=True @@ -874,7 +876,9 @@ def command_freeze(session_name, socket_name, socket_path, force): flag_value=88, help='Like -2, but indicates that the terminal supports 88 colours.', ) -@click.option('--log-file', 'log_file', help='File to log output to') +@click.option( + '--log-file', 'log_file', default=None, help='File to log output to' +) def command_load( ctx, config, @@ -884,6 +888,7 @@ def command_load( answer_yes, detached, colors, + log_file ): """Load a tmux workspace from each CONFIG. From 0650d14dff42b12ea79572c3e92425828cf2d74d Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Sat, 7 Nov 2020 07:16:39 -0800 Subject: [PATCH 06/16] moving load --log-file feature to new branch --- tmuxp/cli.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tmuxp/cli.py b/tmuxp/cli.py index 5bbf5869f2..71044496bd 100644 --- a/tmuxp/cli.py +++ b/tmuxp/cli.py @@ -876,9 +876,6 @@ def command_freeze(session_name, socket_name, socket_path, force): flag_value=88, help='Like -2, but indicates that the terminal supports 88 colours.', ) -@click.option( - '--log-file', 'log_file', default=None, help='File to log output to' -) def command_load( ctx, config, @@ -887,8 +884,7 @@ def command_load( new_session_name, answer_yes, detached, - colors, - log_file + colors ): """Load a tmux workspace from each CONFIG. From 705f7d890a0effb49a43a53e5c9ebdec4d39d2eb Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Sat, 7 Nov 2020 07:50:15 -0800 Subject: [PATCH 07/16] Updating debug-info docs --- docs/cli.rst | 16 ++++++++++++++++ pyproject.toml | 2 +- tmuxp/__about__.py | 2 +- tmuxp/cli.py | 8 ++++---- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/docs/cli.rst b/docs/cli.rst index 59cb2cee60..5d9b3fc4be 100644 --- a/docs/cli.rst +++ b/docs/cli.rst @@ -184,6 +184,22 @@ are created, the last session is named from the terminal. $ tmxup load -s ... +.. _cli_debug_info: + +Debug Info +---------- + +Use to collect all relevant information for submitting an issue to the project. + +.. code-block:: bash + + $ tmuxp debug-info + -------------------------- + environment: + system: Linux + arch: x86_64 + ... + .. _cli_import: Import diff --git a/pyproject.toml b/pyproject.toml index 1338e43e52..303d32cc86 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ skip-string-normalization = true [tool.poetry] name = "tmuxp" -version = "1.6.1" +version = "1.7.0" description = "tmux session manager" license = "MIT" authors = ["Tony Narlock "] diff --git a/tmuxp/__about__.py b/tmuxp/__about__.py index 7fe395812e..035d1fd44a 100644 --- a/tmuxp/__about__.py +++ b/tmuxp/__about__.py @@ -1,6 +1,6 @@ __title__ = 'tmuxp' __package_name__ = 'tmuxp' -__version__ = '1.6.1' +__version__ = '1.7.0' __description__ = 'tmux session manager' __email__ = 'tony@git-pull.com' __author__ = 'Tony Narlock' diff --git a/tmuxp/cli.py b/tmuxp/cli.py index 71044496bd..b87d6a7e71 100644 --- a/tmuxp/cli.py +++ b/tmuxp/cli.py @@ -1081,7 +1081,7 @@ def prepend_tab(strings): strings )) - def generate_output_break(): + def output_break(): """ Generate output break. """ @@ -1100,14 +1100,14 @@ def format_tmux_resp(std_resp): ]) output = [ - generate_output_break(), + output_break(), 'environment:\n%s' % '\n'.join(prepend_tab([ 'system: %s' % os.uname().sysname, 'arch: %s' % os.uname().machine, 'os: {0} {1}'.format(os.uname().nodename, os.uname().version), 'kernel: %s' % os.uname().release, ])), - generate_output_break(), + output_break(), 'python version: %s' % ' '.join(sys.version.split('\n')), 'system PATH: %s' % os.environ['PATH'], 'tmux version: %s' % get_version(), @@ -1116,7 +1116,7 @@ def format_tmux_resp(std_resp): 'tmux path: %s' % which('tmux'), 'tmuxp path: %s' % tmuxp_path, 'shell: %s' % os.environ['SHELL'], - generate_output_break(), + output_break(), 'tmux sessions:\n%s' % format_tmux_resp( tmux_cmd('list-sessions') ), From 9bb5e921bb59286134867bf655943d27f5697336 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Sat, 7 Nov 2020 08:01:44 -0800 Subject: [PATCH 08/16] removed redundant which import --- tmuxp/cli.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tmuxp/cli.py b/tmuxp/cli.py index b87d6a7e71..d2aba24bf0 100644 --- a/tmuxp/cli.py +++ b/tmuxp/cli.py @@ -20,8 +20,7 @@ has_minimum_version, which, get_version, - tmux_cmd, - which + tmux_cmd ) from libtmux.exc import TmuxCommandNotFound from libtmux.server import Server From 31f7a729ab4fce38bcf2d0bee8ecec61e9d675ba Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Sat, 7 Nov 2020 08:03:43 -0800 Subject: [PATCH 09/16] Updating CHANGES --- CHANGES | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES b/CHANGES index be938951cb..5529eb9d67 100644 --- a/CHANGES +++ b/CHANGES @@ -6,6 +6,7 @@ Here you can find the recent changes to tmuxp current ------- +- :issue:`352` New command ``tmuxp debug-info`` for creating github issues - *Insert changes/features/fixes for next release here* tmuxp 1.6.1 (2020-11-07) From 22bd6982c0eed704b96a613bde48188a15e37934 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Sat, 7 Nov 2020 08:05:45 -0800 Subject: [PATCH 10/16] running black over changes --- tests/test_cli.py | 2 +- tmuxp/cli.py | 70 ++++++++++++++++++++--------------------------- 2 files changed, 31 insertions(+), 41 deletions(-) diff --git a/tests/test_cli.py b/tests/test_cli.py index ca30bda96c..1e3e0cc000 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -972,4 +972,4 @@ def test_debug_info_cli(): assert 'tmux windows' in cli_output assert 'tmux panes' in cli_output assert 'tmux global options' in cli_output - assert 'tmux window options' in cli_output \ No newline at end of file + assert 'tmux window options' in cli_output diff --git a/tmuxp/cli.py b/tmuxp/cli.py index d2aba24bf0..bd2df2235d 100644 --- a/tmuxp/cli.py +++ b/tmuxp/cli.py @@ -16,11 +16,11 @@ from click.exceptions import FileError from libtmux.common import ( - has_gte_version, - has_minimum_version, - which, + has_gte_version, + has_minimum_version, + which, get_version, - tmux_cmd + tmux_cmd, ) from libtmux.exc import TmuxCommandNotFound from libtmux.server import Server @@ -855,9 +855,7 @@ def command_freeze(session_name, socket_name, socket_path, force): @click.argument('config', type=ConfigPath(exists=True), nargs=-1) @click.option('-S', 'socket_path', help='pass-through for tmux -S') @click.option('-L', 'socket_name', help='pass-through for tmux -L') -@click.option( - '-s', 'new_session_name', help='start new session with new session name' -) +@click.option('-s', 'new_session_name', help='start new session with new session name') @click.option('--yes', '-y', 'answer_yes', help='yes', is_flag=True) @click.option( '-d', 'detached', help='Load the session without attaching it', is_flag=True @@ -883,7 +881,7 @@ def command_load( new_session_name, answer_yes, detached, - colors + colors, ): """Load a tmux workspace from each CONFIG. @@ -1075,10 +1073,7 @@ def prepend_tab(strings): """ Prepend tab to strings in list. """ - return list(map( - lambda x: '\t%s' % x, - strings - )) + return list(map(lambda x: '\t%s' % x, strings)) def output_break(): """ @@ -1090,22 +1085,26 @@ def format_tmux_resp(std_resp): """ Format tmux command response for tmuxp stdout. """ - return '\n'.join([ - *prepend_tab(std_resp.stdout), - click.style( - '\n'.join(prepend_tab(std_resp.stderr)), - fg='red' - ) - ]) + return '\n'.join( + [ + *prepend_tab(std_resp.stdout), + click.style('\n'.join(prepend_tab(std_resp.stderr)), fg='red'), + ] + ) output = [ output_break(), - 'environment:\n%s' % '\n'.join(prepend_tab([ - 'system: %s' % os.uname().sysname, - 'arch: %s' % os.uname().machine, - 'os: {0} {1}'.format(os.uname().nodename, os.uname().version), - 'kernel: %s' % os.uname().release, - ])), + 'environment:\n%s' + % '\n'.join( + prepend_tab( + [ + 'system: %s' % os.uname().sysname, + 'arch: %s' % os.uname().machine, + 'os: {0} {1}'.format(os.uname().nodename, os.uname().version), + 'kernel: %s' % os.uname().release, + ] + ) + ), output_break(), 'python version: %s' % ' '.join(sys.version.split('\n')), 'system PATH: %s' % os.environ['PATH'], @@ -1116,21 +1115,12 @@ def format_tmux_resp(std_resp): 'tmuxp path: %s' % tmuxp_path, 'shell: %s' % os.environ['SHELL'], output_break(), - 'tmux sessions:\n%s' % format_tmux_resp( - tmux_cmd('list-sessions') - ), - 'tmux windows:\n%s' % format_tmux_resp( - tmux_cmd('list-windows') - ), - 'tmux panes:\n%s' % format_tmux_resp( - tmux_cmd('list-panes') - ), - 'tmux global options:\n%s' % format_tmux_resp( - tmux_cmd('show-options', '-g') - ), - 'tmux window options:\n%s' % format_tmux_resp( - tmux_cmd('show-window-options', '-g') - ) + 'tmux sessions:\n%s' % format_tmux_resp(tmux_cmd('list-sessions')), + 'tmux windows:\n%s' % format_tmux_resp(tmux_cmd('list-windows')), + 'tmux panes:\n%s' % format_tmux_resp(tmux_cmd('list-panes')), + 'tmux global options:\n%s' % format_tmux_resp(tmux_cmd('show-options', '-g')), + 'tmux window options:\n%s' + % format_tmux_resp(tmux_cmd('show-window-options', '-g')), ] click.echo('\n'.join(output)) From 019f5433f2d34ba1eac2322c8dc305d0a80a0f8a Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Sat, 7 Nov 2020 08:14:06 -0800 Subject: [PATCH 11/16] Updating README with debug-info command --- README.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.rst b/README.rst index dc9f150d30..5ed311bb74 100644 --- a/README.rst +++ b/README.rst @@ -177,6 +177,21 @@ You can auto confirm the prompt. In this case no preview will be shown. $ tmuxp convert --yes filename +Debug Info +--------- + +Collect system info to submit with a Github issue + +.. code-block:: sh + + $ tmuxp debug-info + -------------------------- + environment: + system: Linux + arch: x86_64 + ... + + Docs / Reading material ----------------------- From fec95e4d97f221e0ab72bb19f1d3efac4ae71673 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Sat, 7 Nov 2020 10:41:14 -0800 Subject: [PATCH 12/16] fixing python2 incompatible code --- tmuxp/cli.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tmuxp/cli.py b/tmuxp/cli.py index bd2df2235d..7d0ab249bb 100644 --- a/tmuxp/cli.py +++ b/tmuxp/cli.py @@ -1085,12 +1085,10 @@ def format_tmux_resp(std_resp): """ Format tmux command response for tmuxp stdout. """ - return '\n'.join( - [ - *prepend_tab(std_resp.stdout), - click.style('\n'.join(prepend_tab(std_resp.stderr)), fg='red'), - ] - ) + return [ + '\n'.join(prepend_tab(std_resp.stdout)), + click.style('\n'.join(prepend_tab(std_resp.stderr)), fg='red'), + ] output = [ output_break(), From 1acb58c774a2bf0adcd86668b1bec8b474c8930b Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Sat, 7 Nov 2020 11:13:36 -0800 Subject: [PATCH 13/16] updating the logic of debug-info output format --- tmuxp/cli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tmuxp/cli.py b/tmuxp/cli.py index 7d0ab249bb..a04fe5c633 100644 --- a/tmuxp/cli.py +++ b/tmuxp/cli.py @@ -1085,10 +1085,10 @@ def format_tmux_resp(std_resp): """ Format tmux command response for tmuxp stdout. """ - return [ + return '\n'.join([ '\n'.join(prepend_tab(std_resp.stdout)), click.style('\n'.join(prepend_tab(std_resp.stderr)), fg='red'), - ] + ]) output = [ output_break(), From 3c25058e61801b17aa93973cf2f2cebf6ace3c19 Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Sat, 7 Nov 2020 11:15:28 -0800 Subject: [PATCH 14/16] running black over changes trying monkey patch in debug-info test testing parts of the debug-info command test to narrow down problem removing os specifics from debug-info to see if the python ones come through python internals only testing adding SHELL back in adding SHELL to debug_info_test via monkeypatch adding python version back in Adding os variables back in --- tests/test_cli.py | 4 +++- tmuxp/cli.py | 11 +++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/test_cli.py b/tests/test_cli.py index 1e3e0cc000..c60d3b528c 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -956,7 +956,9 @@ def test_ls_cli(monkeypatch, tmpdir): assert cli_output == '\n'.join(stems) + '\n' -def test_debug_info_cli(): +def test_debug_info_cli(monkeypatch, tmpdir): + monkeypatch.setenv('SHELL', '/bin/bash') + runner = CliRunner() cli_output = runner.invoke(command_debug_info).output assert 'environment' in cli_output diff --git a/tmuxp/cli.py b/tmuxp/cli.py index a04fe5c633..9b3dcb2a81 100644 --- a/tmuxp/cli.py +++ b/tmuxp/cli.py @@ -24,6 +24,7 @@ ) from libtmux.exc import TmuxCommandNotFound from libtmux.server import Server + from libtmux import __version__ as libtmux_version from . import config, exc, log, util, __file__ as tmuxp_path @@ -1085,10 +1086,12 @@ def format_tmux_resp(std_resp): """ Format tmux command response for tmuxp stdout. """ - return '\n'.join([ - '\n'.join(prepend_tab(std_resp.stdout)), - click.style('\n'.join(prepend_tab(std_resp.stderr)), fg='red'), - ]) + return '\n'.join( + [ + '\n'.join(prepend_tab(std_resp.stdout)), + click.style('\n'.join(prepend_tab(std_resp.stderr)), fg='red'), + ] + ) output = [ output_break(), From 5efacb05d20d85f42f949d5de7fe2bac8ea1f58e Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Sat, 7 Nov 2020 13:20:33 -0800 Subject: [PATCH 15/16] changing from os to platform for better system data coverage removing version from uname output since it is on the next line --- tmuxp/cli.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tmuxp/cli.py b/tmuxp/cli.py index 9b3dcb2a81..72e79ce624 100644 --- a/tmuxp/cli.py +++ b/tmuxp/cli.py @@ -9,6 +9,7 @@ import logging import os +import platform import sys import click @@ -1099,10 +1100,10 @@ def format_tmux_resp(std_resp): % '\n'.join( prepend_tab( [ - 'system: %s' % os.uname().sysname, - 'arch: %s' % os.uname().machine, - 'os: {0} {1}'.format(os.uname().nodename, os.uname().version), - 'kernel: %s' % os.uname().release, + 'dist: %s' % platform.platform(), + 'arch: %s' % platform.machine(), + 'uname: %s' % '; '.join(platform.uname()[:3]), + 'version: %s' % platform.version(), ] ) ), From 6444bb9c6e1170a10a456c02aa407e4d5a547c3a Mon Sep 17 00:00:00 2001 From: Joseph Flinn Date: Sun, 8 Nov 2020 09:08:36 -0800 Subject: [PATCH 16/16] updating the version --- pyproject.toml | 2 +- tmuxp/__about__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 303d32cc86..56bd8985bd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ skip-string-normalization = true [tool.poetry] name = "tmuxp" -version = "1.7.0" +version = "1.6.2" description = "tmux session manager" license = "MIT" authors = ["Tony Narlock "] diff --git a/tmuxp/__about__.py b/tmuxp/__about__.py index 035d1fd44a..eaa33c135f 100644 --- a/tmuxp/__about__.py +++ b/tmuxp/__about__.py @@ -1,6 +1,6 @@ __title__ = 'tmuxp' __package_name__ = 'tmuxp' -__version__ = '1.7.0' +__version__ = '1.6.2' __description__ = 'tmux session manager' __email__ = 'tony@git-pull.com' __author__ = 'Tony Narlock'