MacOS-关闭bash会话还原


2

我试过编辑/ etc / bashrc_Apple_Terminal以及将.bash_profiles等文件添加到主文件夹中,但是我的会话历史记录一直显示-当我打开终端时,它将打开3个带有其历史记录的窗口。该怎么办?谢谢!

编辑:SHELL_SESSION_HISTORY = 0不能正常工作


添加SHELL_SESSION_HISTORY=0~/bash_profile,(请注意问题中没有s结尾profile)对macOS High Sierra来说适用于我。你必须要么source~/bash_profile或关闭并重新打开了变化采取终端。您正在运行什么版本的macOS?
user3439894 '18

Answers:


1

如果要放弃终端状态,则必须按住Alt键退出。菜单将从“退出终端”更改为“退出并关闭所有窗口”。

在此处输入图片说明

您还可以通过以下方式使用“ normal” quit Cmd+ 使其生效Q

  1. 打开你的终端
  2. 删除已保存状态文件夹的内容: rm -rf ~/Library/Saved\ Application\ State/com.apple.Terminal.savedState/*
  3. 锁定文件夹: chflags uchg ~/Library/Saved\ Application\ State/com.apple.Terminal.savedState/
  4. 现在,每次您退出终端时,它都不会保存
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.