diff options
-rw-r--r-- | share/functions/fish_config.fish | 7 | ||||
-rw-r--r-- | share/tools/web_config/index.html | 18 | ||||
-rwxr-xr-x | share/tools/web_config/webconfig.py | 11 |
3 files changed, 32 insertions, 4 deletions
diff --git a/share/functions/fish_config.fish b/share/functions/fish_config.fish index de59d834..10f15f09 100644 --- a/share/functions/fish_config.fish +++ b/share/functions/fish_config.fish @@ -1,3 +1,8 @@ function fish_config --description "Launch fish's web based configuration" - eval $__fish_datadir/tools/web_config/webconfig.py + # Support passing an initial tab like "colors" or "functions" + set -l initial_tab + if test (count $argv) > 0 + set initial_tab $argv[1] + end + eval $__fish_datadir/tools/web_config/webconfig.py $initial_tab end diff --git a/share/tools/web_config/index.html b/share/tools/web_config/index.html index b61a7e7a..d29f179b 100644 --- a/share/tools/web_config/index.html +++ b/share/tools/web_config/index.html @@ -1189,7 +1189,23 @@ function update_table_filter_text_box(allow_transient_message) { $(document).ready(function() { populate_colorpicker_term256() - switch_tab('tab_colors') + var tab_name + switch (window.location.hash) { + case '#functions': + tab_name = 'tab_functions' + break + case '#variables': + tab_name = 'tab_variables' + break + case '#history': + tab_name = 'tab_history' + break + case '#colors': + default: + tab_name = 'tab_colors' + break; + } + switch_tab(tab_name) }) </script> diff --git a/share/tools/web_config/webconfig.py b/share/tools/web_config/webconfig.py index ce1b701a..cf004719 100755 --- a/share/tools/web_config/webconfig.py +++ b/share/tools/web_config/webconfig.py @@ -374,9 +374,16 @@ if PORT > 9000: print("Unable to find an open port between 8000 and 9000") sys.exit(-1) - -url = 'http://localhost:{0}'.format(PORT) +# Get any initial tab (functions, colors, etc) +# Just look at the first letter +initial_tab = '' +if len(sys.argv) > 1: + for tab in ['functions', 'colors', 'variables', 'history']: + if tab.startswith(sys.argv[1]): + initial_tab = '#' + tab + break +url = 'http://localhost:{0}/{1}'.format(PORT, initial_tab) print("Web config started at '{0}'. Hit enter to stop.".format(url)) webbrowser.open(url) |