Posts

Showing posts from February, 2013

Is Android's FLAG_NEW_TASK named rightly???

According to an Android's document , FLAG_ACTIVITY_NEW_TASK Start the activity in a new task. If a task is already running for the activity you are now starting, that task is brought to the foreground with its last state restored and the activity receives the new intent in onNewIntent(). So, it seems FLAG_ACTIVITY_NEW is FLAG_ACTIVITY_NEW_WHEN_NOT_AVAILABLE_OTHERWISE_USE_EXISTING_ONE in truth. This name cast me a very long journey all the way around to return back to FLAG_ACTIVITY_NEW and FLAG_ACTIVITY_CLEAR_TOP combination....

Change tmux key-bind conditionally, depending on which pane are you in.

For long time since I switched from gnu screen to tmux, I have been a little wondering is there any way to change tmux behavior depending on which pane I am working. What I wanted to do is to enlarge a pane when I moved to the pane so that I can work on the bigger pane. This is a bit convenient to know which pane I am moving in and keep terminal window smaller for a laptop. I finally figured out how to do it today, I want to share it with you. (Maybe 10 more people on the earth want this info, I guess.) Key bind is like this in .tmux.conf. bind C-a if "tmux display-message -p | awk '{exit($5=0)}'" "resize-pane -D 16" \; last-pane \; resize-pane -U 8 Points are "if-shell" tmux command and -p option for tmux "display-message". As you can see, this does not work well on three or more panes, but I usually don't do that so it's OK for me. If you want it, you should add condition to second resize-pane. Any suggestion would b...