Silently accept forward slash for special commands#1937
Merged
rolandwalker merged 1 commit intoJun 20, 2026
Conversation
0dfe017 to
7fcfca0
Compare
* commands such as "\?" can be entered as "/?"
* commands heretofore without a backslash such as "help" can be entered
as "/help"
Thus all special commands can be entered, uniformly, with an
introductory forward slash, yet "\dt" can remain available, similar to
Postgres, and plain "exit" can remain, similar to the vendor MySQL
client.
This helps both new learners and those with muscle memory.
The only limitation to the _introductory_ forward slash is that MyCli
could never use "/*" (comment-start) as a special command.
For _trailing_ commands, there is also a limitation. Trailing commands
such as "\edit" cannot also be entered as "/edit", since a string can be
an expression, which is valid SQL:
select 1 as edit group by 2/edit;
SpecialCommand already had a "hidden" property, which is used here to
keep the forward-slash forms from being advertised in "help", so they
can be considered to be experimental. However, the plan would be to
advertise the forward-slash forms quite soon in MyCli 2.x. Hidden
forward-slash commands are also still completable.
Some small incidental improvements are made to the detection of special
commands by case, and on the acceptance of "/? <term>" for help on a
term.
Motivation: the forward slash has become something of an industry
standard for out-of-band commands, consistent across modern applications
such as Slack, Codex, or Claude. It also has a long heritage in, for
example, IRC. On most keyboards, it is easier to type than the
backslash.
7fcfca0 to
431c647
Compare
scottnemes
approved these changes
Jun 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Silently accept forward slash for special commands.
\?can be entered as/?helpcan be entered as/helpThus all special commands can be entered, uniformly, with an introductory forward slash, yet
\dtcan remain available, similar to Postgres, and plainexitcan remain, similar to the vendor MySQL client.This helps both new learners and those with muscle memory.
The only limitation to the introductory forward slash is that MyCli could never use
/*(comment-start) as a special command.For trailing commands, there is also a limitation. Trailing commands such as
\editcannot also be entered as/edit, since a string can be an expression, which is valid SQL:SpecialCommandalready had a "hidden" property, which is used here to keep the forward-slash forms from being advertised inhelp, so they can be considered to be experimental. However, the plan would be to advertise the forward-slash forms quite soon in MyCli 2.x. Hidden forward-slash commands are also still completable.Some small incidental improvements are made to the detection of special commands by case, and on the acceptance of
/? <term>for help on a term.Motivation: the forward slash has become something of an industry standard for out-of-band commands, consistent across modern applications such as Slack, Codex, or Claude. It also has a long heritage in, for example, IRC. On most keyboards, it is easier to type than the backslash.
Checklist
changelog.mdfile.AUTHORSfile (or it's already there).