Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

So I just created the .bash_aliases and wrote the following:

callNotepad(){
     wine C:\\Program\ Files\\Notepad++\\notepad++.exe $1
}

alias notepad++=callNotepad

Now whether notepad++ is already running or not, if it is not it does open notepad++ and either way, it opens whatever file I specify when I call

notepad++ someFile

However, if notepad++ was not running prior to that command, it gives me a

fixme:ole:RemUnknown_QueryInterface No interface for iid {00000019-0000-0000-c000-000000000046}

and then blocks the calling terminal for as long as notepad is running.

How would I implement that alias correctly? For I have no idea what that fixme is supposed to tell me.

Also, I would prefer not having to open a second terminal after opening a file in notepad++ (ctrl+C reenables the terminal but closes notepad++).

share|improve this question
    
Couldn't you just do callNotepad(){ wine C:\\Program\ Files\\Notepad++\\notepad++.exe $1 & } alias notepad++=callNotepad –  Yet Another User Sep 19 '13 at 20:03

1 Answer 1

up vote 1 down vote accepted

Run the command in the background.

callNotepad(){
     wine 'C:\Program Files\Notepad++\notepad++.exe' "$1" &
}

If you want to silence the errors, redirect them into silence.

callNotepad(){
     wine 'C:\Program Files\Notepad++\notepad++.exe' "$1" 2>/dev/null &
}

Note that this may also silence useful errors, so use at your own risk.

share|improve this answer
    
Still gives me the errors but now it does not close notepad anymore when Ctrl+C out of them. Thank you. –  User1291 Sep 19 '13 at 20:16
    
The "errors" are because Wine, nothing to do with the issue. –  Braiam Sep 19 '13 at 20:18
    
@User1291 The error is due to Wine not being a perfect emulation of Windows. You can't do anything about it. You can silence the errors (see my edit) but this may cause you to miss useful error messages. –  Gilles Sep 19 '13 at 20:20
    
I don't really feel like taking the risk of missing something that I actually should worry about so I'll just ctrl+c and clear. Thanks for clearing that up, though. –  User1291 Sep 19 '13 at 20:26
    
if you want to avoid using wine: use geany instead of notepad++ (they are almost identical) –  thom Oct 29 '13 at 1:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.