I have (voltron) for LLDB. Windows of registers, a stack, etc. opens separately. How to customize windows so that they settled down all together, how on the picture? I know that it is necessary to use tmuxinator.
I'll try to describe each step. First, you need to install voltron, if you have not already done so. Detailed instructions here https://github.com/snare/voltron
Next, install tmux. I used homebrew.
brew install tmux
In order to get an view, like on the picture, you should customize tmuxinator (more information here https://github.com/tmuxinator/tmuxinator).
In the terminal write command
echo $EDITOR
export EDITR='vim'
tmuxinator new voltron
You should customize the .yml file. I used the settings by the voltron author's, but YAML is very particular about how much space is used where (thanks to https://github.com/ethagnawl). To edit voltron.yml i did use the 'i' button, to save the Esc and 'Z'.
# ~/.tmuxinator/voltron.yml
name: voltron
root: ~/
windows:
# two spaces
- madhax:
# four spaces
layout: 15a8,169x41,0,0{147x41,0,0[147x13,0,0{81x13,0,0,60,65x13,82,0,61},147x19,0,14,62,147x7,0,34{89x7,0,34,63,57x7,90,34,64}],21x41,148,0,65}
panes:
# two spaces
- voltron view disasm
- voltron view bp
- lldb
- voltron view stack
- voltron view bt
- voltron view reg
To run tmux using:
tmuxinator start voltron
Related
I have iTerm Build 3.3.9 installed. I have configured oh-my-zsh with following plugins & themes
ZSH_THEME="powerlevel10k/powerlevel10k"
ZSH_DISABLE_COMPFIX="true"
plugins=(aws git colored-man-pages colorize github virtualenv pip python osx zsh-syntax-highlighting zsh-completions zsh-autosuggestions django npm zsh-interactive-cd zsh-navigation-tools)
Now there are 2 issues that i am trying to solve
See the , I have written the command uptil aws cognito-i and remaining is appearing as autosuggestion. the problem is that with my setup (probably theme but i have tried multiple themes) i am unable to distinguish between the command that i have typed and the command is being suggested. normally suggested command should appear a little dimmer but its the same color/opacity as the one that i have written. how to fix this
The second issue is that whenever i run a command with aws cli (also with aws-nuke, the response is opened with a new vi type window, i.e., the commands get removed and i see blank window with each line starting with ~ and at the end of the window it says END. Why is it happening and how to fix this as well
To fix the first issue try moving zsh-syntax-highlighting to the very end of plugins. From zsh-syntax-highlighting FAQ:
Why must zsh-syntax-highlighting.zsh be sourced at the end of the .zshrc file?
zsh-syntax-highlighting.zsh wraps ZLE widgets. It must be sourced
after all custom widgets have been created (i.e., after all zle -N
calls and after running compinit). Widgets created later will work,
but will not update the syntax highlighting.
To fix the second issue add the following at the end of ~/.zshrc:
# Use `less` as pager in Zsh.
READNULLCMD=less
# Use `less` as pager in external commands.
export PAGER=less
# This affects every invocation of `less`.
#
# -i case-insensitive search unless search string contains uppercase letters
# -R color
# -F exit if there is less than one page of content
# -X keep content on screen after exit
# -M show more info at the bottom prompt line
# -x4 tabs are 4 instead of 8
export LESS=-iRFXMx4
I run
kubectl edit deployment
to change the version of one of my pods (this commands opens a temp file in my text editor and then I usually edit and close this temp file) and even before I close this temp file in my text editor I can see the following note in my bash.
Edit cancelled, no changes made.
It was OK before I installed fish and I tried to switch to bash but it doesn't help either.
How can I fix it?
Things like this are most likely caused by it opening an editor that forks off instead of staying.
That means you'll want to set $EDITOR to an editor that does wait. E.g. nano, vim or emacs should work, and e.g. if you use sublime text you'll have to use subl -w to explicitly tell it to wait.
It's not quite clear which shell you're running at the moment. If it's bash, run export EDITOR="subl -w", in fish run set -gx EDITOR subl -w (or "subl -w" if you use fish < 3.0).
A refinement to the ample answer provided by #faho.
An approach with the $EDITOR variable achieves the goal but changes the default command-line editor. This might affect other programs dependent on this setting (e.g. crontab, edquota).
It'd be better to rely on the $KUBE_EDITOR variable. For example for the one-time use you might try:
KUBE_EDITOR="nano" kubectl edit deploy/hello-world
(Please see Editing Resources)
With vim, when you try to save it saves an edited copy which is specified in /tmp/ path, along with the error message, when you quit the editor.
This is equivalent to using get the resource, edit it in text editor, and then apply the resource with the updated version:
kubectl get deployment my-nginx -o yaml > /tmp/nginx.yaml
vim /tmp/nginx.yaml
kubectl apply -f /tmp/nginx.yaml
deployment.apps/my-nginx configured
then remove the file
rm /tmp/nginx.yaml
So basically use apply on the file saved in the /tmp/<file.yaml>
This issue may also happen when changes made by you are not picked by an kubectl eg. because of incorrect YAML.
Please make other change that you are sure of.
After saving check if still getting the same problem
Example issue replication:
the spec.selector.app: xxx" is invalid as it is duplicated;
the last one will remain; the first will be ignored.
so if you just added the first one - it no changes will be made.
spec:
clusterIP: 10.152.183.151
clusterIPs:
- 10.152.183.151
ports:
- port: 80
protocol: TCP
targetPort: 80
selector:
app: xxx
app: rng
I'm trying to use vi mode in bash. via the .inputrc (on OSX):
set editing-mode vi
In vi insert mode, the right arrow key moves the cursor to the right, but it stops on the last character in the line. If the cursor is past the end of the line, it moves the cursor to the left. So, in sum, the farthest right you can go is to the last character in the line.
$ cd /usr/locl/bin
# Move the cursor to the middle of the line, and fix something there
$ cd /usr/local/bin
# Now move the cursor back to the end, and write a character (/)
$ cd /usr/local/bi/n
As shown above this means you cannot edit the end of the line without going into command mode (and using 'a').
I found an article which seems to indicate the version of readline/bash might be the problem. However I used brew to upgrade bash (GNU bash, version 4.3.42), and even tried to install and link readline (6.3.8), as recommend by that site. But no luck. Its possible the upgrade was done incorrectly.
This means I'm looking for one of the following:
The proper way to upgrade bash and readline in OSX terminal
A way to check the versions of bash/readline that OSX is actually using
Another fix for this bug (somehow passing in the virtualedit=onemore option in the inputrc)
Indications that the latest versions of readline might have re-introduced the bug, and solutions.
Also: if theres a similar thing with editrc
Note: I'm looking to make readline in bash act near identical to the default (for others who periodically use my terminal), but allow me to use vim mode. This means I don't need workarounds, but fixes.
Answer here: https://unix.stackexchange.com/a/222506/198846
Apparently it's a bug in the bash version shipped with OSX (3.2), it's fixed in 4.3 according to that answer. Use bash --version to check your bash version.
To fix, update bash, e.g.
macports: sudo port install bash
brew: brew install bash
Once installed bash --version will show it's updated (assuming standard brew/macports paths at the start of your $PATH)
You then have to change your default login shell (in System Preferences->Users & Groups->right click your user->advanced options->login shell) to the path of the new bash:
(default) macports: /opt/local/bin/bash
(default) brew: /usr/local/bin/bash
Changing the default login shell step is required even if which bash shows the macports/brew one.
All credit to the answer linked above.
Can't you edit .bashrc itself instead to use vi mode? The command set -o vi does it in my case (you are in edit mode initially). Also remove the .inputrc edit as the two may actually interact nefariously afterwards.
I would like to open all my useful stuff like here in iTerm2:
Not like this:
I'm using tmuxinator I've defined some tabs. I wonder if it's possible to get the former behaviour at all.
I just tried with tmux 1.8. Not totally obvious, but it works.
Here's what you do:
Open iTerm2 (latest, be sure to have at least tmux 1.8 installed).
In iTerm2, run command tmux <your tmuxinator profile>. Then detach ^b d.
In iTerm2, run command tmux -CC attach -t <your session>. You will see your tabs open in different windows.
Open menu Shell->Tmux->Dashboard
Select and hide all the windows.
Select all the hidden windows, and click Open in Tabs.
I'd like to know how to avoid the part about hiding and opening in tabs.
Just wanted to add some comments onto what justingordon mentioned (1).
This all works great. But I found how to streamline step 4-6 so it happens automatically.
Go to iTerm2's Preferences, under General, you will see a section titled tmux. There's an option that says When attaching, open unrecognized windows in. If you change the current selection from Windows to Tabs.
Two extra tips.
If you want you could select the option Automatically hide the tmux client session after connection. This will minimize the iTerm2 window in which you typed
tmux -CC attach
I also enabled the option Focus follows mouse. You can find this option under Preferences then Pointer. It should be the first option on the bottom left.
To use tmuxinator with iterm2 panes, use the following configuration:
attach: false
in combination with
on_project_exit:
- tmux -CC attach -t way
It looks like an issue in the documentations as told here
This is an example that I normally use:
# ~/.tmuxinator/way.yml
name: way
root: ~/learn/ruby/ruby-way/
attach: false
on_project_exit:
- tmux -CC attach -t way
# Runs before everything. Use it to start daemons etc.
on_project_start:
- export EDITOR="emacsclient --server-file=way -c"
- export VISUAL=$EDITOR
- emacs --daemon=way --title=RUBY-WAY
- $EDITOR &
windows:
- console:
- echo "A currar"
- testing:
- echo "A testear"
I hope that this helps.
Add this to your tmuxinator config:
attach: false
post: tmux -CC attach
https://github.com/tmuxinator/tmuxinator/pull/293
I've been meaning to find a solution for this for YEARS.
I am sooo much more productive in vim when manipulating files than bash for this reason.
If I have
file_12390983421
file_12391983421
file_12340983421
file_12390986421
In bash and type file_1->tab , it obviously lists:
file_12390983421 file_12391983421 file_12340983421 file_12390986421
And this is horrible and painful to work with.
The same sequence in vim will loop through the files one at a time.
Please someone tell me how to do this in bash, or if there is another shell that can do this, I'll switch tomorrow.
By default TAB is bound to the complete readline command. Your desired behavior would be menu-complete instead. You can change your readlines settings by editing ~/.inputrc. To rebind TAB, add this line:
TAB: menu-complete
For more details see the READLINE section in man bash.
For bash >= 4 you might like these settings. You can try them directly on the command-line, and put them in your ~/.bash_profile if you like them.
# If there are multiple matches for completion, Tab should cycle through them
bind 'TAB:menu-complete'
# And Shift-Tab should cycle backwards
bind '"\e[Z": menu-complete-backward'
# Display a list of the matching files
bind "set show-all-if-ambiguous on"
# Perform partial (common) completion on the first Tab press, only start
# cycling full results on the second Tab press (from bash version 5)
bind "set menu-complete-display-prefix on"
This setup is similar to Vim's set wildmode=longest:full:list,full
I pulled these settings from this question on the Unix & Linux site.
By the way, since you are here, here are some other great bindings:
# Cycle through history based on characters already typed on the line
bind '"\e[A":history-search-backward'
bind '"\e[B":history-search-forward'
# Keep Ctrl-Left and Ctrl-Right working when the above are used
bind '"\e[1;5C":forward-word'
bind '"\e[1;5D":backward-word'
This means if you type ssh<Up> it will cycle through previous lines where you ran ssh
If you don't like what you got, you can clear the line with Ctrl-K Ctrl-U
I pulled these settings from this question on AskUbuntu.
On top of
# cycle forward
Control-k: menu-complete
# cycle backward
Control-j: menu-complete-backward
you may also consider adding
# display one column with matches
set completion-display-width 1
This way you would preserve the current Tab functionality and make bash display the possibilities in one column. So instead of
file_12340983421 file_12390983421 file_12390986421 file_12391983421
you would get
file_12340983421
file_12390983421
file_12390986421
file_12391983421
P.S. You can get up to date readline library from this The GNU Readline Library website.
Thanks to #sth I found what works best for me:
To keep normal bash tab completion, and then use ctl-f to cycle through when needed using menu-complete
put this in your .inputrc file:
"\C-f": menu-complete
In my experience, the solution provided in sth's answer has never completely worked for me. TL;DR: Add set -o vi to your ~/.bashrc.
When using menu-complete in conjunction with vi keybindings, I have to make sure that my ~/.bashrc has:
set -o vi
It's never been enough for my ~/.inputrc just to have:
TAB: menu-complete
set editing-mode vi
set keymap vi
My guess is that somehow set editing-mode and set keymap are clobbering the TAB: ... setting, but I haven't looked into the documentation thoroughly to figure out why this is the case.