iterm2

Problems with Zsh on macOS after update

本小妞迷上赌 提交于 2019-12-11 11:02:10
问题 After upgrading to macOS 10.15 I have some serious problems with the console. I got strong problems with rbenv and ruby. Any new window or tab from the console gives me the following information: user@macbook-name ~ % rbenv -v rbenv 1.0.0-33-gc7dcaf1 user@macbook-name ~ % which ruby /usr/bin/ruby I tried reinstalling rbenv. I reinstalled ruby through rbenv. I wrote this line in ~/.zshrc file: export PATH="$HOME/.rbenv/bin:$PATH" But as soon as I close the tab or exit the console window or the

How do I set the iTerm2 session title through escape codes?

我的未来我决定 提交于 2019-12-11 05:57:59
问题 The iTerm2 page on badges mentions that session.name can be changed with escape codes, but describes the method somewhat cryptically: session.name The current session's name. Defaults to the profile name. May be changed with the escape sequence OSC 1 ; name ST , or by editing the session title in View>Edit Current Session . If you look further down the page at code describing how to change badges, we see a sort of Rosetta Store: The badge itself may be set with the following escape sequence:

Curses background color not working in iTerm2 with TERM=xterm

回眸只為那壹抹淺笑 提交于 2019-12-11 02:14:15
问题 I have the following code that draws a small window with a message using curses . import curses import time screen = curses.initscr() curses.start_color() curses.init_pair(1, curses.COLOR_WHITE, curses.COLOR_BLUE) window = curses.newwin(15, 60) window.bkgd(' ', curses.color_pair(1)) window.addstr(7, 1, 'Hello') window.refresh() time.sleep(2) curses.endwin() I expect the background color to be blue, but the behavior is not consistent in iTerm2. With TERM=screen , I get the expected output:

macOS 安装lrzsz

我只是一个虾纸丫 提交于 2019-12-10 17:40:16
mac自带的终端是不支持lrzsz的,需要下载安装iterm2 Mac OS 终端利器 iTerm2 安装homebrew brew的MAC安装 macOS 安装lrzsz 进入/usr/local/bin 由于原作者下架了项目,我们只能手动新建脚本了,下面请无脑全部复制即可。 1.创建 iterm2-recv-zmodem.sh #!/bin/bash osascript -e 'tell application "iTerm2" to version' > /dev/null 2>&1 && NAME=iTerm2 || NAME=iTerm if [[ $NAME = "iTerm" ]]; then FILE=`osascript -e 'tell application "iTerm" to activate' -e 'tell application "iTerm" to set thefile to choose folder with prompt "Choose a folder to place received files in"' -e "do shell script (\"echo \"&(quoted form of POSIX path of thefile as Unicode text)&\"\")"` else FILE=`osascript

How to prevent iterm2 from closing when typing Ctrl-D (EOF)

走远了吗. 提交于 2019-12-10 14:06:35
问题 I am using fish shell. When I type Ctrl-D, it sends a EOF to my terminal and then terminal closes. I want to make it such that ctrl-D does not close my iterm2. I saw that people have set up IGNOREEOF in bash shell like this: https://unix.stackexchange.com/questions/27588/how-can-i-keep-controld-from-disconnecting-my-session However, I don't think this variable exists in fish. Does anybody know how I can force iterm2(with default fish shell) to not close on ctrl-D? 回答1: This is the default key

Use CMD-mappings in console Vim

谁都会走 提交于 2019-12-10 10:30:49
问题 Is there a way to use Cmd key for Vim in terminal? Something MacVim does. I have remapped Cmd+S in iTerm2 to send Esc:w!<CR> to save files in Vim, but this sounds a bit weak. With all the power of iTerm and Vim there should be some way to do this right? 回答1: It is possible, but it takes some doing and has some downsides. The first set of issues is that: although iTerm2 can accept the Command keys and pass them on to terminal programs, it can only do so by remapping them as something else, e.g

ITerm2下使用ssh访问Linux

限于喜欢 提交于 2019-12-10 06:33:14
通常情况下,iTerm2访问远程Linux使用ssh,与Termial基本一样,方法如下: ssh <用户名>@<ip> 然后输入访问的密码即可。当然还有的时候需要指定访问端口。 ssh -p <端口号> <用户名>@<ip地址> 如果在iTerm2下的操作与termial一样,我还用它干甚? 当然iTerm2有它特有的功能,这里使用它的是Profiles这个功能。 我们将远程访问的相关内容写成一个脚本,然后在Profile里调用即可。 脚本内容如下: #!/usr/bin/expect -f set user <用户名> set host <ip地址> set password <密码> set timeout -1 spawn ssh $user@$host expect "*assword:*" send "$password\r" interact expect eof 把这个脚本保存起来,放到一个目录下(这个可以根据自己的实际情况来定,没有特殊性) 接下来,就是如何调用这个脚本了. 接下来, 使用命令 expect <保存的脚本完整路径> 保存即可。 接下来就是如何使用了。使用方法也很简单,打开iTerm2后,选择菜单Profiles下自定的profiles即可。 来源: oschina 链接: https://my.oschina.net/u/1765961/blog

iterm2远程ssh连接服务器乱码问题

杀马特。学长 韩版系。学妹 提交于 2019-12-10 06:22:12
服务器是Linux,用Mac的iterm2 ssh连上去,中文显示乱码,也不能输入中文,然而本地终端可以显示和输入 原因: 终端和服务器的字符集不匹配,MacOSX下默认的是utf8字符集 解决方法: 1.打开配置文件(此处使用zsh) vim ~/.zshrc 2.在文件里面添加如下内容 export LC_ALL=en_US.UTF-8 export LANG=en_US.UTF-8 接着重启一下终端,或者输入 source ~/.zshrc 使设置生效。 PS:远端服务器和本地服务器都需要修改,一致即可。 来源: oschina 链接: https://my.oschina.net/u/228302/blog/2221635

iTerm2中文乱码之本地中文正常,远程CentOS中文乱码

删除回忆录丶 提交于 2019-12-10 05:05:18
背景 使用iTerm2远程到CentOS7上面出现,中文乱码问题。 Mac 检查本地编码 zylMBP:~ zhangyalin$ locale LANG= LC_COLLATE="C" LC_CTYPE="C" LC_MESSAGES="C" LC_MONETARY="C" LC_NUMERIC="C" LC_TIME="C" LC_ALL= CentOS # 远程到CentOS上面,检查编码 [admin@Servicenumber ~]$ locale LANG=zh_CN.UTF-8 LC_CTYPE="zh_CN.UTF-8" LC_NUMERIC="zh_CN.UTF-8" LC_TIME="zh_CN.UTF-8" LC_COLLATE="zh_CN.UTF-8" LC_MONETARY="zh_CN.UTF-8" LC_MESSAGES="zh_CN.UTF-8" LC_PAPER="zh_CN.UTF-8" LC_NAME="zh_CN.UTF-8" LC_ADDRESS="zh_CN.UTF-8" LC_TELEPHONE="zh_CN.UTF-8" LC_MEASUREMENT="zh_CN.UTF-8" LC_IDENTIFICATION="zh_CN.UTF-8" LC_ALL= 解决 取消掉iTerm2远程登录时,自动覆盖远程服务器的环境变量。 *

mac下非常好用的命令行工具 iTerm2

北战南征 提交于 2019-12-10 05:02:04
腾讯微博 人人网 微信 下载地址 : http://iterm2.com/ 今天要说的 iTerm2 应该是mac系统中不可多得的命令行工具之一.简单列出几点给我们带来方便快捷的功能点. 选中即复制 我们之前用过的命令行要么是不能使用常规复制快键键来复制操作,要么是选中后再按键复制,iTerm2很特殊,选中就自动复制成功. 去你需要粘贴的地方按下 command + v 即可粘贴成功. 更多mac相关快键键 全文查找功能,就和我们在文本编辑器中编辑文字一样,只需要command + f 输入要查找的内容,即可在当前命令行页面查找并高亮显示,如图所示: 搜索 register 在界面查找并全部高亮显示,点击搜索框右侧箭头可以循环逐个定位 分隔屏幕显示,水平分隔 command +shift +d 水平分隔界面后,黑色的为当前激活窗口,灰色是未激活窗口,我们现在还可以在当前激活窗口再进行垂直分隔,按下快键键: 垂直分隔 command+d 保存ssh远程登录指令,如图左侧是本地ssh 登录服务器地址 和 阿里云 服务器登录地址 上图右侧是iTerm2 的另外一个新功能,保存上一次tab按键所在的目录,打开新窗口自动定位到使用tab键所在的目录. 比如下图中我使用tab键定位到 ~/code 目录 ,接着水平分屏新建了一个窗口,默认自动定位到了 ~/code 目录下.需要如下设置 按下