From ae7e8111c0a3304b1094a2d53b94b5993b77fc2c Mon Sep 17 00:00:00 2001 From: amtoine Date: Thu, 13 Jul 2023 18:26:12 +0200 Subject: [PATCH] simplify hooks and set `display_output` to `table` `table` is the default behaviour for `display_output` without any config. --- .../src/sample_config/default_config.nu | 20 +++++-------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/crates/nu-utils/src/sample_config/default_config.nu b/crates/nu-utils/src/sample_config/default_config.nu index 143ac453a2..d7082a5d29 100644 --- a/crates/nu-utils/src/sample_config/default_config.nu +++ b/crates/nu-utils/src/sample_config/default_config.nu @@ -302,23 +302,13 @@ $env.config = { render_right_prompt_on_last_line: false # true or false to enable or disable right prompt to be rendered on last line of the prompt. hooks: { - pre_prompt: [{|| - null # replace with source code to run before the prompt is shown - }] - pre_execution: [{|| - null # replace with source code to run before the repl input is run - }] + pre_prompt: [{ null }] # run before the prompt is shown + pre_execution: [{ null }] # run before the repl input is run env_change: { - PWD: [{|before, after| - null # replace with source code to run if the PWD environment is different since the last repl input - }] - } - display_output: {|| - if (term size).columns >= 100 { table -e } else { table } - } - command_not_found: {|| - null # replace with source code to return an error message when a command is not found + PWD: [{|before, after| null }] # run if the PWD environment is different since the last repl input } + display_output: { table } # run before the output of a command is drawn + command_not_found: { null } # return an error message when a command is not found } menus: [