top of page
Search
Writer's pictureTeam GoplarDB

MySQL Shell 8 Prompt: Now with New Line Provision

In this blog, I will demonstration a new feature of MySQL Shell 8.0.13 which enhances provision to have a line break in the speedy and silent get multi line declarations align properly. I will first converse why you may need to use the innovative feature, then go over the new prototypes by means of this feature, and in conclusion show my present favorite prompt.


Why Practice a New Line in the Prompt?

You can ask why this feature is required? The MySQL Shell prompt has provision for screening a lot of statistics. While this is very pleasant, it also brands the prompt relatively long. When you then take your request/declaration, it needs a fair amount of tangible estate. Addition a new line in the prompt lets you to retain all the great info while silent restraining the inclusive with of the prompt. The subsequent figure displays a evaluation of the only line prompt with a multi-line prompt:

MySQL Shell 8.0.13: Relating single and multi-line prompts


Message that in the example, the multi-line prompt comprises the MySQL Server version which is not involved in the single line prompt. It can of sequence be discussed which of the two forms is desirable, but that is the attractiveness of MySQL Shell: you can select the prompt that you desire.

Now, let’s guise at the new-fangled templates in MySQL Shell 8.0.13.


Innovative Prompt Templates with Line Breaks

There are three original prompt templates in the MySQL Shell setting up. The quick prototypes are in /usr/share/mysqlsh/prompt/ on Linux and C:\Program Files\MySQL\MySQL Shell 8.0\share\mysqlsh\prompt on Microsoft Windows. You might also need to evaluation the blog Arranging the MySQL Shell Quick for more nearby the prompt prototypes. The three innovative prompt prototypes are:


  • prompt_dbl_256.json: The hasty uses 256 indexed colors. This is a two-line version of the defaulting prompt both on Oracle Linux 7 and Microsoft Windows 10.

  • prompt_dbl_256pl.json: Like the prompt_dbl_256.json prompt but by means of the Powerline font.

  • prompt_dbl_256pl+aw.json: Furthermore, totaling the Awesome font symbols.


If you equate the prompt_dbl_256.json prototype with the default prompt_256.json prototype, the change is:

The change among the prompt_256.json and prompt_dbl_256.json prototypes.


So, a original line is shaped by means of the "break": true syntax. That’s it. The other alteration in the screen report is just to style the second line of the speedy be slightly depressed.


This is boundless – if you need a new line formerly the end of the prompt, you can unbiassed use one of the new prototypes. Nevertheless, in my view I favor to have my prompt somewhat diverse.


My Favorite Prompt

My preferred prompt uses mutually the Awesome and Powerline fonts as fine as addition a new line. I prefer the line breakdown just formerly the language means (the prototypes have the interruption after the mode). In addition, I add the MySQL Server type (the value of the type system variable), and I practice the Powerline extractor on each new line.


The whole prompt description is:

Samples of the resultant prompt are:

Sample of the new prompt feature in MySQL Shell 8.0.13 with multi line requests.

66 views0 comments

Recent Posts

See All

Deleting Duplicate Rows in MySQL

In this blog, you will study several ways to delete duplicate rows in MySQL. In this blog, I have shown you how to find duplicate values...

Comments


bottom of page