Hi Kazu,

在 2023/9/29 8:44, HAGIO KAZUHITO(萩尾 一仁) 写道:
On 2023/09/21 11:00, Huang Shijie wrote:
Add the clear command for crash.
Use it to clear the screen.
Sorry, but I would not like to add a command just to do this.

My final purpose is to use 'alias' to map the command to 'c':

       alias c clear



Currently, we can run the clear command like this:

   crash> !clear
If this is not acceptable to you, crash has some external commands that 
can be run without the exclamation mark(!), so I would suggest adding 
the command to them:

static int
is_external_command(void)
{
         int i;
         char *cmd;
         char command[BUFSIZE];

         cmd = args[0];

         if (STREQ(cmd, "vi") ||
             STREQ(cmd, "pwd") ||
             STREQ(cmd, "grep") ||
             STREQ(cmd, "cat") ||
             STREQ(cmd, "more") ||
             STREQ(cmd, "less") ||
             STREQ(cmd, "echo") ||
-           STREQ(cmd, "ls")) {
+           STREQ(cmd, "ls") ||
+           STREQ(cmd, "clear")) {

I okay with this one.

could you please create a patch for it?


Thanks

Huang Shijie