forked from enlightenment/terminology
Add main_new_with_dir() to enable open a term in a specifc path
This commit is contained in:
parent
7530e8d304
commit
f5687a7e32
|
@ -354,19 +354,17 @@ _term_focus_show(Split *sp, Term *term)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
main_new(Evas_Object *win, Evas_Object *term)
|
main_new_with_dir(Evas_Object *win, Evas_Object *term, const char *wdir)
|
||||||
{
|
{
|
||||||
Split *sp = _split_find(win, term);
|
Split *sp = _split_find(win, term);
|
||||||
Config *config;
|
Config *config;
|
||||||
int w, h;
|
int w, h;
|
||||||
char buf[PATH_MAX], *wdir = NULL;
|
|
||||||
|
|
||||||
if (!sp) return;
|
if (!sp) return;
|
||||||
_term_resize_track_stop(sp);
|
_term_resize_track_stop(sp);
|
||||||
evas_object_hide(sp->term->bg);
|
evas_object_hide(sp->term->bg);
|
||||||
config = config_fork(sp->term->config);
|
config = config_fork(sp->term->config);
|
||||||
termio_size_get(sp->term->term, &w, &h);
|
termio_size_get(sp->term->term, &w, &h);
|
||||||
if (termio_cwd_get(sp->term->term, buf, sizeof(buf))) wdir = buf;
|
|
||||||
sp->term = main_term_new(sp->wn, config,
|
sp->term = main_term_new(sp->wn, config,
|
||||||
NULL, EINA_FALSE, wdir,
|
NULL, EINA_FALSE, wdir,
|
||||||
w, h, EINA_FALSE);
|
w, h, EINA_FALSE);
|
||||||
|
@ -379,6 +377,16 @@ main_new(Evas_Object *win, Evas_Object *term)
|
||||||
_split_tabcount_update(sp, sp->term);
|
_split_tabcount_update(sp, sp->term);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
main_new(Evas_Object *win, Evas_Object *term)
|
||||||
|
{
|
||||||
|
Split *sp = _split_find(win, term);
|
||||||
|
char buf[PATH_MAX], *wdir = NULL;
|
||||||
|
|
||||||
|
if (termio_cwd_get(sp->term->term, buf, sizeof(buf))) wdir = buf;
|
||||||
|
main_new_with_dir(win, term, wdir);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
main_split_h(Evas_Object *win, Evas_Object *term)
|
main_split_h(Evas_Object *win, Evas_Object *term)
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,6 +8,7 @@ typedef struct _Term Term;
|
||||||
typedef struct _Split Split;
|
typedef struct _Split Split;
|
||||||
|
|
||||||
void main_new(Evas_Object *win, Evas_Object *term);
|
void main_new(Evas_Object *win, Evas_Object *term);
|
||||||
|
void main_new_with_dir(Evas_Object *win, Evas_Object *term, const char *wdir);
|
||||||
void main_split_h(Evas_Object *win, Evas_Object *term);
|
void main_split_h(Evas_Object *win, Evas_Object *term);
|
||||||
void main_split_v(Evas_Object *win, Evas_Object *term);
|
void main_split_v(Evas_Object *win, Evas_Object *term);
|
||||||
void main_close(Evas_Object *win, Evas_Object *term);
|
void main_close(Evas_Object *win, Evas_Object *term);
|
||||||
|
|
Loading…
Reference in New Issue