Как я могу обеспечить пустую строку перед каждым новым приглашением?

499
KatieK

Я использую пакет Cmder для своей среды командной строки Windows. Некоторые команды не создают пустую строку после их завершения, что может затруднить просмотр каждой команды, которая была выполнена. Есть ли способ настроить командную строку так, чтобы она печатала новую строку перед отображением пути и приглашения?

0

2 ответа на вопрос

1
SaxDaddy

The classic DOS prompt is c:\Windows> which is set by using the system variable PROMPT to "$P$G". (With newer versions of Windows, it's not an environment variable but you can still use the prompt command to set it.)

Change the value for PROMPT to add $_ where you see fit. That will add a new linefeed to the prompt. I added $s to get a space after the >.

C:\Users\me> prompt $P$_$G$s C:\Users\me > dir \ Volume in drive C has no label. Volume Serial Number is 5CE6-9877 Directory of C:\ 08/22/2013 08:22 AM <DIR> PerfLogs 03/05/2014 10:25 AM <DIR> Program Files 03/05/2014 10:26 AM <DIR> Program Files (x86) 01/22/2014 05:14 PM <DIR> Users 01/22/2014 06:15 PM <DIR> Windows 0 File(s) 0 bytes 5 Dir(s) 36,451,704,832 bytes free C:\Users\me > 

BTW, the list of prompt options can be found at http://technet.microsoft.com/en-us/library/bb490977.aspx

Это сработало для меня. В моей реализации Cmder мне нужно было изменить переменную @prompt в `Cmdr \ vendor \ init.bat`. KatieK 10 лет назад 0
0
Ƭᴇcʜιᴇ007

Add $_ to your Prompt environment variable to add a new line before showing the wanted prompt.

So assuming your prompt is the standard $p$gto get prompt like c:\directory>, change it as such:

set prompt=$_$p$g

$_       Carriage return and linefeed

Use Setx to set it permanently.

More info on Prompt