The history-command max-size command sets the size of the history command buffer.
The undo history-command max-size command restores the default size of the history command buffer.
By default, you can store 10 history commands.
<HUAWEI> system-view [~HUAWEI] user-interface vty 0 4 [~HUAWEI-ui-vty0-4] history-command max-size 20
<HUAWEI> system-view [~HUAWEI] user-interface console 0 [~HUAWEI-ui-console0] history-command max-size 20