LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-24-2017, 12:41 PM   #1
Johnny_Metal
Member
 
Registered: Feb 2016
Posts: 68

Rep: Reputation: 1
Keyboard shortcut to start vim from tmux from mate-terminal


Hello everyone,

I'm trying to figure out a keyboard shortcut which starts the mate-terminal on a specific directory, with a specific profile, a tmux session and, from within that same session, automatically start vim. So far, I am able to start the terminal and tmux with the following command:

Code:
mate-terminal --maximize --profile=Vim --working-directory="/my/working/directory" -e tmux
I cannot figure out how to start vim from within tmux though. I have tried
Code:
-e "tmux -c vim"
to no avail.

Any suggestions?
 
Old 08-24-2017, 12:52 PM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 5,668
Blog Entries: 3

Rep: Reputation: 2904Reputation: 2904Reputation: 2904Reputation: 2904Reputation: 2904Reputation: 2904Reputation: 2904Reputation: 2904Reputation: 2904Reputation: 2904Reputation: 2904
I would use --execute or -x instead of -e with mate-terminal. After that, the real problem comes from the quotes. Do the following without quotes:

Code:
. . .  --execute tmux -c vi
Or even better, use the full paths for tmux and vi

See "man mate-terminal" for the explanation of the options and their differences.
 
Old 08-25-2017, 03:24 AM   #3
Johnny_Metal
Member
 
Registered: Feb 2016
Posts: 68

Original Poster
Rep: Reputation: 1
Your suggestions have the same results of what I tried, and I actually forgot to mention those results. The end result is that I have a terminal running vim, but not tmux.
 
Old 08-25-2017, 03:58 AM   #4
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 5,668
Blog Entries: 3

Rep: Reputation: 2904Reputation: 2904Reputation: 2904Reputation: 2904Reputation: 2904Reputation: 2904Reputation: 2904Reputation: 2904Reputation: 2904Reputation: 2904Reputation: 2904
Which distro, including version, are you seeing this on? I'm not able to duplicate the problem on Devuan Ascii. You might also try the following though I feel it is a bit of a kludge:

Code:
mate-terminal --maximize --profile=Vim --working-directory="/my/working/directory" \
    --execute /usr/bin/tmux new-session -s "vim session" \; send-keys -t 0 '/usr/bin/vi' enter
Edit: simpler:
Code:
mate-terminal --maximize --profile=Vim --working-directory="/my/working/directory" \
    --execute /usr/bin/tmux new-session -s VIM '/usr/bin/vi'

Last edited by Turbocapitalist; 08-25-2017 at 04:09 AM.
 
1 members found this post helpful.
Old 08-25-2017, 05:14 AM   #5
Johnny_Metal
Member
 
Registered: Feb 2016
Posts: 68

Original Poster
Rep: Reputation: 1
I'm sorry, I had ignored what you said at the end of your first post:

Quote:
Or even better, use the full paths for tmux and vi
It now works perfectly. Thank you very much!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bodhi - keyboard shortcut to open terminal? Dark Corner Bodhi 8 07-03-2018 01:49 AM
Tip: 24-bit True Color Terminal + tmux + vim dugan Slackware 12 08-05-2017 07:14 PM
keyboard shortcut for terminal in slackware using xfce sigint-ninja Linux - Newbie 4 01-05-2016 09:15 PM
gnome-terminal:keyboard shortcut launches terminal with / directory default! deepclutch Linux - Desktop 1 06-21-2010 11:48 AM
Keyboard Shortcut to Terminal Kyrocera Linux - Newbie 4 12-18-2006 02:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration