For AIX dbx, why is there a syntax error with "set edit emacs" in the .dbxinit command file?

96 views Asked by At

On AIX 7.2, I am using the dbx debugger. Through a command set edit emacs one can enable an "emacs" line editing mode in dbx, which allows you to edit the current command line with keyboard shortcuts like ^A, ^K, ^Y, and so on (similar to what works on the command lines in bash and ksh), and, most importantly for me, it also allows you to access the history of commands in dbx through ^P and ^N (previous and next command, respectively). Dbx allows one to put commands in a file called ~/.dbxinit, which will have these commands executed at the start of the dbx session.

To always have the emacs mode enabled by default (and another option that repeats the last command if you press enter without entering another command) I have created the following .dbxinit file:

set $repeat
set edit emacs

However, when I start dbx now, I get the following error output:

/home/redacted/.dbxinit: 2: set edit emacs
         ^ syntax error

(The redacted username is also 8 characters long, so the caret for the syntax error is out of place in the original output as well.)

Is this a bug in the dbx implementation or is there anything that prevents setting the edit mode from the startup command file? Is there something else that I can write in the file to get this mode enabled by default?

When I swap the two lines of the file, the error happens on line 1 instead, so I assume that it has nothing to do with the set $repeat line.

The alternative syntax set -o emacs raises the same error. Setting the vi mode instead of emacs mode fails in the same way.

The alternative of setting the EDITOR environment variable to emacs works correctly. But I do not really want to set the editor in my shell to emacs in general, I only want to put dbx into that line editing mode.

Sources:

0

There are 0 answers