Skip to content

你的Windows终端变成了虚空终端!/ Turn your Windows terminal into the Akasha Terminal!

License

Notifications You must be signed in to change notification settings

DuckDuckStudio/powered_by_akasha_terminal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Powered by 虚空终端

展示图

把你的Windows终端变成虚空终端!
玩__玩的
LICENSE: MIT

Note

本项目原名[Power by 虚空终端]。但在后续发现,似乎不是Power by而是Powered by(这下尴尬了)
随机即按项目Issues #1的建议将项目修改为了[Powered by 虚空终端]
感谢哔哩哔哩上的网友的指出,也感谢UP主鸭鸭_カモ对本项目的介绍!
发疯时写的项目,自然容易出错。一看就是整天想着 “This, is power!” 导致的。
如有因项目名称修改导致的链接失效,请提交 Issues .

中文 | English

实现效果

[PowerShell中]
PowerShell中的效果展示图

[cmd中]
cmd中的效果展示图

如何实现

PowerShell

  • 永久
    • 原先没有配置文件
      你可以下载仓库发行版中的Microsoft.PowerShell_profile.ps1,然后将这个文件放在C:\Users\user_name\Documents\WindowsPowerShell\中。(文件夹不存在的话就新建文件夹)
      如果希望一并修改标题的话可以加上:
      $host.UI.RawUI.WindowTitle = "虚空终端"
      • 如果出现错误
        如果出现类似这样的错误:
      . : File C:\Users\user_name\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
      
      请尝试:
      * 以管理员身份启动 PowerShell
      * 运行以下命令以查看当前的执行策略:
      Get-ExecutionPolicy
      如果返回的结果不是 RemoteSignedUnrestricted,则表示 PowerShell 正在运行限制了脚本执行的执行策略。你可以使用以下命令来更改执行策略:
      Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
      这将允许当前用户在本地运行自签名的脚本文件,而不会询问用户确认。
      最后,重新启动 PowerShell 应该就可以解决这个问题了。
      • 如果遇到其他错误请提交 Issues
      • 如果你是从项目中文git来的,到这里你就该回去了,Issues也请不要提交到这个项目上,请提交到中文git的Issues上。
        点我快速返回 中文git 项目
    • 原先存在配置文件
      你可以运行以下命令打开 PowerShell 的配置文件:
    notepad $PROFILE
    在打开的配置文件中添加以下代码:
    function prompt {
      Write-Host "[Powered by 虚空终端] " -NoNewline -ForegroundColor Cyan
      return "PS $($executionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) "
    }
    # Code by DuckStudio
    # Version 1.1
    保存并关闭配置文件后重启 PowerShell 即可
    如果希望一并修改标题的话可以加上:
    $host.UI.RawUI.WindowTitle = "虚空终端"
  • 一次性
    如果你不想每次都有[Powered by 虚空终端],只想要当前的 PowerShell 有[Powered by 虚空终端],则你可以在 PowerShell 中运行以下指令:
function prompt {
  Write-Host "[Powered by 虚空终端] " -NoNewline -ForegroundColor Cyan
  return "PS $($executionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) "
}
# Code by DuckStudio
# Version 1.1
# 注意:这是多行代码

如果希望一并修改标题的话可以加上:

$host.UI.RawUI.WindowTitle = "虚空终端"

这只会在当前 PowerShell 会话中有效。

cmd

  • 一次性
    如果你不想每次都有[Powered by 虚空终端],只想要当前的 cmd 有[Powered by 虚空终端],则你可以在 cmd 中运行以下指令:
prompt [Powered by 虚空终端] $P$G

如果希望一并修改标题的话可以加上:

title 虚空终端

这只会在当前 cmd 会话中有效。

如果设置为永久该如何取消

  1. 运行以下命令打开 PowerShell 的配置文件:
notepad $PROFILE
  1. 删除在配置文件中添加的代码
  2. 保存并关闭配置文件后重启 PowerShell 即可

如何修改内容

什么?!你竟然不喜欢虚空终端?!
修改代码中的[Powered by 虚空终端] 部分即可

Note

需要注意的是,PowerShell 的代码在内容的后面还有一个空格

例如:

  • 在 PowerShell 中
function prompt {
    Write-Host "[Powered by 纳西妲] " -NoNewline -ForegroundColor Cyan
    return "PS $($executionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) "
}
# Code by DuckStudio
# Version 1.1
# 注意:这是多行代码

效果:
Powered by 纳西妲

  • 在 cmd 中
prompt [Powered by 纳西妲] $P$G

效果:
Powered by 纳西妲

关于翻译

为什么不翻译[Powered by]?
我保留了一部分英语,这样你才能知道你用的是终端(

About

你的Windows终端变成了虚空终端!/ Turn your Windows terminal into the Akasha Terminal!

Topics

Resources

License

Stars

Watchers

Forks